Permalink
Browse files

Add a click() trigger to the thumbnail hover() event

  • Loading branch information...
1 parent 4fa6be9 commit 84ca9ed7587db3337030ca1c7a11d197b21e4d4b @haraldpdl haraldpdl committed Oct 17, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 catalog/ext/jquery/jquery.bxGallery.1.1.min.js
@@ -23,4 +23,4 @@ cont+='<li><img src="'+$this.attr('src')+'" /></li>';});$orig.find('li:not(:firs
function place_thumbcontainer(){if(o.thumbplacement=='top'){$outer.prepend('<ul class="thumbs">'+cont+'</ul>');$outer.find('.thumbs').css({'overflow':'auto'});}else if(o.thumbplacement=='left'){$outer.prepend('<ul class="thumbs">'+cont+'</ul>');$orig.css({'float':'left'});$outer.find('.thumbs').css({'float':'left'});}else if(o.thumbplacement=='bottom'){$outer.append('<ul class="thumbs">'+cont+'</ul>');}else if(o.thumbplacement=='right'){$outer.append('<ul class="thumbs">'+cont+'</ul>');$orig.css({'float':'left'});$outer.find('.thumbs').css({'float':'left'});}
$outer.append('<div style="clear:both"></div>');if(o.thumbcontainer!=''){$outer.find('.thumbs').width(o.thumbcontainer);}}
function set_thumbs(){$outer.find('.thumbs li').each(function(){var $this=$(this);var $img=$this.find('img');var $imgwidth=$img.width();var $imgheight=$img.height();if(o.thumbcrop){$img.width($imgwidth*o.croppercent);$img.height(($imgheight/$imgwidth)*$img.width());$this.css({'float':'left','width':o.thumbwidth,'height':o.thumbwidth,'overflow':'hidden','cursor':'pointer'});}else{$img.width(o.thumbwidth);$img.height(($imgheight/$imgwidth)*o.thumbwidth);$this.css({'float':'left','cursor':'pointer'});$this.height($img.height());}
-$this.click(function(){var x=$outer.find('.thumbs li').index($this);if(showing!=x){$orig.find('li').fadeOut();$orig.find('li').eq(x).fadeIn();showing=x;}});});var $thumb=$outer.find('.thumbs li');$thumb.eq(0).addClass('on');$thumb.not('.on').fadeTo(0,o.opacity);$thumb.click(function(){var t=$(this);var i=$thumb.index(this);if(current!=i){$thumb.removeClass('on');t.addClass('on');$thumb.not('.on').fadeTo(200,o.opacity);current=i;}}).hover(function(){$(this).stop().fadeTo(200,1);},function(){$(this).not('.on').stop().fadeTo(200,o.opacity);});}}});})(jQuery);
+$this.click(function(){var x=$outer.find('.thumbs li').index($this);if(showing!=x){$orig.find('li').fadeOut();$orig.find('li').eq(x).fadeIn();showing=x;}});});var $thumb=$outer.find('.thumbs li');$thumb.eq(0).addClass('on');$thumb.not('.on').fadeTo(0,o.opacity);$thumb.click(function(){var t=$(this);var i=$thumb.index(this);if(current!=i){$thumb.removeClass('on');t.addClass('on');$thumb.not('.on').fadeTo(200,o.opacity);current=i;}}).hover(function(){$(this).stop().fadeTo(200,1);$(this).click();},function(){$(this).not('.on').stop().fadeTo(200,o.opacity);});}}});})(jQuery);

0 comments on commit 84ca9ed

Please sign in to comment.