最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to get gallery to automatically move - Stack Overflow

programmeradmin0浏览0评论

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

This is the script

.slidingGallery-1.2.min.js

I am using this script

.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 trying to get this gallery to automatically move, but i cant find the mand to do so in the script. Maybe i am missing something? Here is the script.

This is the script

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

I am using this script

http://www.meadmiracle./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>
Share Improve this question edited Nov 29, 2011 at 6:16 fnp 6,1983 gold badges35 silver badges43 bronze badges asked Nov 21, 2011 at 5:54 soniccoolsoniccool 6,05823 gold badges63 silver badges101 bronze badges 2
  • I dont think this script has autoSliding feature – Sudhir Bastakoti Commented Nov 21, 2011 at 6:04
  • Hmm is there any way i can implement it? – soniccool Commented Nov 21, 2011 at 6:07
Add a ment  | 

4 Answers 4

Reset to default 8 +250

I am cross-posting my answer from https://stackoverflow./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>

Not sure what else you are looking for with your bounty, but my remendation is to use a carousel that does exactly what you want.

I have had nothing but good experiences with http://caroufredsel.frebsite.nl/. The author is quick to answer questions, add features, and even has a setup wizard to get the slideshow going with almost zero manual configuration.

There are options for it to be circular, infinite, auto-play, keyboard driven, pause-on-hover, set cookies, changes directions, etc etc.

I'm not involved with the project at all, but this is the only gallery I'll use for my work.

Call these methods yourself?

$.galleryUtility.slideRight( ) 
$.galleryUtility.slideLeft( ) 

since it's Jquery, you can use "stepcarousel.js" → http://www.dynamicdrive./dynamicindex4/stepcarousel.htm then you can include this line of code in your script to invoke the auto function.

autostep: {enable: true, moveby:1, pause:5000},

hope this helps...

发布评论

评论列表(0)

  1. 暂无评论