1

单击缩略图时,标准的galeriffic 画廊会在图像之间淡出。如何更改图库,以便图像从页面滑到右侧,显示下面的下一个图像?谢谢

<script>
    jQuery(document).ready(function($) {
        // We only want these styles applied when javascript is enabled
        $('div.navigation').css({'width' : '300px', 'float' : 'left'});
        $('div.content').css('display', 'block');

        // Initially set opacity on thumbs and add
        // additional styling for hover effect on thumbs
        var onMouseOutOpacity = 1.0;
        $('#thumbs ul.thumbs li').opacityrollover({
            mouseOutOpacity:   onMouseOutOpacity,
            mouseOverOpacity:  1.0,
            fadeSpeed:         'fast',
            exemptionSelector: '.selected'
        });

        // Initialize Advanced Galleriffic Gallery
        var gallery = $('#thumbs').galleriffic({
            delay:                     2500,
            numThumbs:                 100,
            preloadAhead:              100,
            enableTopPager:            true,
            enableBottomPager:         true,
            maxPagesToShow:            100,
            imageContainerSel:         '#slideshow',
            controlsContainerSel:      '#controls',
            captionContainerSel:       '#caption',
            loadingContainerSel:       '#loading',
            renderSSControls:          false,
            renderNavControls:         false,
            playLinkText:              '',
            pauseLinkText:             '',
            prevLinkText:              '',
            nextLinkText:              '',
            nextPageLinkText:          '',
            prevPageLinkText:          '',
            enableHistory:             false,
            autoStart:                 false,
            syncTransitions:           true,
            defaultTransitionDuration: 900,
            onSlideChange:             function(prevIndex, nextIndex) {
                // 'this' refers to the gallery, which is an extension of $('#thumbs')
                this.find('ul.thumbs').children()
                    .eq(prevIndex).fadeTo('fast', onMouseOutOpacity).end()
                    .eq(nextIndex).fadeTo('fast', 1.0);
            },
            onPageTransitionOut:       function(callback) {
                this.fadeTo('fast', 0.0, callback);
            },
            onPageTransitionIn:        function() {
                this.fadeTo('fast', 1.0);
            }
        });
    });
</script>
4

1 回答 1

1

您可以像这样使用 jQuery clickanimateremove函数:

$('#thumbs ul.thumbs').click(function() {
  var self = $(this);    
  self.animate({left: '+=500'}, 1000, 'linear', function() {
    self.remove();
  });
});

这基本上意味着:

  • 订阅与“#thumbs ul.thumbs”选择器匹配的所有元素的点击事件
  • 单击元素时
  • 动画它向右移动 500 像素
  • 移除元素
于 2011-11-18T23:41:30.043 回答