jQuery Image Gallery画廊插件

jQuery Image Gallery画廊插件

jQuery Image Gallery是一个全屏的画廊插件,和qq空间相册插件类似。支持自定义图片名称、相册标题。

淘建站为您提供更多_图片代码_图片轮播_画廊_gallery,在此特别感谢您对我们的支持与厚爱!

查看演示

演示不了,点击反馈

加入收藏

下载 165 次

下载资源

53 积分

特别说明:本站资源来自网友发布分享,仅供学习与参考,请勿用于商业用途,若有侵权请联系删除(272966172@qq.com)。

HTML

每个元素.content,里面放置图片,图片上有标题title,即幻灯片标题

<div class="content">
    <div><a href="images/Universe_and_planets_digital_art_wallpaper_denebola.jpg"><img src="images/Universe_and_planets_digital_art_wallpaper_denebola_thumb.jpg" title="" alt="" class="thumb" /></a></div>
</div>
<div class="content">
    <div><a href="images/Universe_and_planets_digital_art_wallpaper_lux.jpg"><img src="images/Universe_and_planets_digital_art_wallpaper_lux_thumb.jpg" title="网站模板" alt="网站模板" class="thumb" /></a></div>
</div>

引入jQuery库和easing动画插件

<script type="jquery.min.js"></script> 
<script type="text/javascript" src="jquery.easing.1.3.js"></script>

jQuery Image Gallery调用方法

$(window).load(function() {
    $toolbar.data("imageViewMode", $defaultViewMode); //default view mode
    if ($defaultViewMode == "full") {
        $toolbar_a.html("<img src='toolbar_n_icon.png' width='50' height='50'  />").attr("onClick", "ImageViewMode('normal');return false").attr("title", "Restore");
    } else {
        $toolbar_a.html("<img src='toolbar_fs_icon.png' width='50' height='50'  />").attr("onClick", "ImageViewMode('full');return false").attr("title", "Maximize");
    }
    ShowHideNextPrev($nextPrevBtnsInitState);
//thumbnail scroller
    $thumbScroller_container.css("marginLeft", $tsMargin + "px"); //add margin
    sliderLeft = $thumbScroller_container.position().left;
    sliderWidth = $outer_container.width();
    $thumbScroller.css("width", sliderWidth);
    var totalContent = 0;
    fadeSpeed = 200;

    var $the_outer_container = document.getElementById("outer_container");
    var $placement = findPos($the_outer_container);

    $thumbScroller_content.each(function() {
        var $this = $(this);
        totalContent += $this.innerWidth();
        $thumbScroller_container.css("width", totalContent);
        $this.children().children().children(".thumb").fadeTo(fadeSpeed, $thumbnailsOpacity);
    });

    $thumbScroller.mousemove(function(e) {
        if ($thumbScroller_container.width() > sliderWidth) {
            var mouseCoords = (e.pageX - $placement[1]);
            var mousePercentX = mouseCoords / sliderWidth;
            var destX = -((((totalContent + ($tsMargin * 2)) - (sliderWidth)) - sliderWidth) * (mousePercentX));
            var thePosA = mouseCoords - destX;
            var thePosB = destX - mouseCoords;
            if (mouseCoords > destX) {
                $thumbScroller_container.stop().animate({left: -thePosA}, $scrollEasing, $scrollEasingType); //with easing
            } else if (mouseCoords < destX) {
                $thumbScroller_container.stop().animate({left: thePosB}, $scrollEasing, $scrollEasingType); //with easing
            } else {
                $thumbScroller_container.stop();
            }
        }
    });

    $thumbnails_wrapper.fadeTo(fadeSpeed, $thumbnailsContainerOpacity);
    $thumbnails_wrapper.hover(
            function() { //mouse over
                var $this = $(this);
                $this.stop().fadeTo("slow", 1);
            },
            function() { //mouse out
                var $this = $(this);
                $this.stop().fadeTo("slow", $thumbnailsContainerMouseOutOpacity);
            }
    );

    $thumbScroller_thumb.hover(
            function() { //mouse over
                var $this = $(this);
                $this.stop().fadeTo(fadeSpeed, 1);
            },
            function() { //mouse out
                var $this = $(this);
                $this.stop().fadeTo(fadeSpeed, $thumbnailsOpacity);
            }
    );

//on window resize scale image and reset thumbnail scroller
    $(window).resize(function() {
        FullScreenBackground("#bgimg", $bgimg.data("newImageW"), $bgimg.data("newImageH"));
        $thumbScroller_container.stop().animate({left: sliderLeft}, 400, "easeOutCirc");
        var newWidth = $outer_container.width();
        $thumbScroller.css("width", newWidth);
        sliderWidth = newWidth;
        $placement = findPos($the_outer_container);
    });

//load 1st image
    var the1stImg = new Image();
    the1stImg.onload = CreateDelegate(the1stImg, theNewImg_onload);
    the1stImg.src = $bgimg.attr("src");
    $outer_container.data("nextImage", $(".content").first().next().find("a").attr("href"));
    $outer_container.data("prevImage", $(".content").last().find("a").attr("href"));
});

声明:本资料由淘建站会员提供,如转载注明来源,资料来源淘建站免费素材库:https://www.taojz.cn/texiao/483.html
jQuery Image Gallery画廊插件 希望对你有帮助,感谢您的支持!
  • gridrotator.js响应式图片画廊插件

    gridrotator.js响应式图片画廊插件

  • baguetteBox图片弹出层插件

    baguetteBox图片弹出层插件

  • 留言(0)
    头像
     阿里云限量代金券,戳我领取
    1 2