如何让图库自动移动 [英] How to get gallery to automatically move

查看:123
本文介绍了如何让图库自动移动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图让这个画廊自动移动,但我无法在脚本中找到这样的命令。也许我错过了什么?这是脚本。



这是脚本

http://syndicatebox.com/jquery.slidingGallery-1.2.min.js



我我正在使用此脚本



http://www.meadmiracle.com/SlidingGallery .aspx



我使用这个来调用脚本来工作。
但是我无法使用这个功能来让它自动滑动而不点击。

 < script language = javascripttype =text / javascript> 
$(函数(){
$('div.gallery img')。slidingGallery({
Lwidth:400,
Lheight:300,
Lshrink:function (dim){return dim * 0.5;},
gutterWidth:-8,
container:$('div.gallery')
});
});
< / script>


解决方案

我从 https://stackoverflow.com/q/8250488/128165

 < script type =text / javascript> 
var autoSlideInterval;

function start_autoslide(){
autoSlideInterval = setInterval(function(){
$ .galleryUtility.slideLeft();
},5000);
}

function stop_autoslide(){
clearInterval(autoSlideInterval); ();


$(function(){
$('div.gallery img')。slidingGallery();
start_autoslide();
} );

< / script>


I am trying to get this gallery to automatically move, but i cant find the command to do so in the script. Maybe i am missing something? Here is the script.

This is the script

http://syndicatebox.com/jquery.slidingGallery-1.2.min.js

I am using this script

http://www.meadmiracle.com/SlidingGallery.aspx

I am using this to call the script to work. But i am unable of the function here to make it automatically slide without clicking.

<script language="javascript" type="text/javascript">
    $(function() {
        $('div.gallery img').slidingGallery({
            Lwidth: 400,
            Lheight: 300,
            Lshrink: function(dim) { return dim * 0.5; },
            gutterWidth: -8,
            container: $('div.gallery')     
        });
    });
</script>

解决方案

I am cross-posting my answer from https://stackoverflow.com/q/8250488/128165

<script type="text/javascript">
    var autoSlideInterval;

    function start_autoslide(){
        autoSlideInterval = setInterval( function(){
            $.galleryUtility.slideLeft() ;
        }, 5000);
    }

    function stop_autoslide(){
        clearInterval( autoSlideInterval );
    }

    $(function() {
        $('div.gallery img').slidingGallery(); 
        start_autoslide();
    });

</script>

这篇关于如何让图库自动移动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆