I have this piece of code, and I need to target only the first click for one line and normal clicks for the rest.
$esCarousel.show().elastislide({
imageW : 240,
onClick : function( $item ) {
if( anim ) return false;
anim = true;
// only in the FIRST CLICK click show wrapper (expected but don't work)
_addImageWrapper();
// on click show image
_showImage($item);
// change current
current = $item.index();
}
});
When i click the item, everything works great, but when I click again I need only the “$_showImage($item);” and not the “_addImageWrapper();”.
Can you help me? I'm really a newbie about js :(
UPDATE: When I close (close with fadeOut) It won't open again! It must be because the carousel is already been clicked… how can I “reset” the click?
$navClose.on('click.rgGallery', function( event ) {
$('.rg-image-wrapper').fadeOut('2000');
return false;
});
Thanks for the help, I'm learning this (I think :x)!