简体   繁体   中英

How to make a slider autoscroll using jquery

http://405pixels.gowerpowered.com

I have the slider, and I have been trying to figure out how to make the homepage autoslide?

I tried using firebug to locate the files... Located some .js files that contain some information about the homepage slider... but all the changes and everything I make seem to not be working...

This is a free template I found called BigFoot. I am really interested into learning about how this javascript would work that is why I downloaded in the first place... to learn from the template... If you could point me in the right direction that would be awesome.

Thanks, Alex

You'll need to replace the actual photo swapping code with whatever you use but the rest will swap out each picture every 5 seconds.

$(document).ready(function() {
  var next = $('#right-button');

  next.click(function() {
    $('#current-picture').fadeOut('fast');
    $('#next-picture').fadeIn('fast');
    ...whatever code you use for this.
  });

  var scroll = setInterval(function() {
    next.trigger("click");
    if(picture is last) {
      clearInterval(scroll);
    }
  }, 5000);
});

you are using flex slider so you can use the code below.

jQuery(window).load(function() {
    jQuery('.flexslider').flexslider( {
    pauseOnHover: true,
        slideshow: false,
        controlsContainer: ".flex-container"
    } );
} );

actually this it the param you need to pass to make slider autostart

slideshow: false,

Let me know if you run into any other issues.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM