Skip to content

Instantly share code, notes, and snippets.

@raeno
Created February 20, 2013 09:48
Show Gist options
  • Save raeno/4994345 to your computer and use it in GitHub Desktop.
Save raeno/4994345 to your computer and use it in GitHub Desktop.
Showing and hiding overlay
product_quantity = $('.product-quantity');
product_quantity.click ->
current = $(this)
event.stopPropagation();
current.parent().find('.items-count-spinner').show();
current.find('.item-count').focus();
position = current.position();
$('.items-count-spinner').css({
'top' : position.top - 5,
'left' : position.left - 25,})
$('body').click ->
if ($(event.target).parents('.items-count-spinner').length == 0)
$('.items-count-spinner').hide();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment