SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Member ashadweb's Avatar
    Join Date
    Aug 2006
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    JQuery slide play auto

    I have customize a JQuery slide show. But it doesn't load automatic

    http://bit.ly/rfQ4j1

    Source:
    Create a Slick and Accessible Slideshow Using jQuery
    I'm a Freelance Web Designer. Web design, That's My Passion.

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,117
    Mentioned
    448 Post(s)
    Tagged
    8 Thread(s)
    What do you mean by "load automatic"?

    Do you want the panels to slide by themselves, without clicking? If so, do you also want left/right arrows, stop/start on hover etc? There are lots of galleries out there, each slightly different, which you can use without having to change anything.
    Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form

    Forum Usage: Tips on posting code samples, images and more

    Forrest Gump: "IE is like a box of chocolates: you never know what you're gonna get."

  3. #3
    SitePoint Enthusiast Anthony.Barnes's Avatar
    Join Date
    Aug 2011
    Location
    Canberra, Australia
    Posts
    80
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The sixrevisions site you got the code from isn't loading for me, but I looked at the home_slide.js file you have on the site. There is nothing in there that is telling this slide show to do anything periodically. You would need/want to add some functions to next(), previous(), pause() and play() and then use the javascript function setInterval() that will trigger the next() function peridocally.

    The code I see in there isn't really built to function like that, extra controls would have to be added and logic around restarting your slideshow once it rotates to the end. Here is a quick example (untested and not ideal, but hopefully enough for you to get an idea):

    Code:
    var interval = null;
    
    function play(delay) {
        interval = setInterval(next,delay*1000);
    }
    
    function pause() {
       clearInterval(interval);
    }
    
    function next() {
        $('#rightControl').trigger('click');
    }
    
    function prev() {
        $('#leftControl').trigger('click');
    }
    
    play(3); // Start playing with a 3 second delay
    I added the pause in because starting something triggered periodically you should always give users an option to stop or pause, you'll probably want to add a design element that will give users control over playing and pausing your slideshow.

  4. #4
    SitePoint Member ashadweb's Avatar
    Join Date
    Aug 2006
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Anthony.Barnes View Post
    The sixrevisions site you got the code from isn't loading for me, but I looked at the home_slide.js file you have on the site. There is nothing in there that is telling this slide show to do anything periodically. You would need/want to add some functions to next(), previous(), pause() and play() and then use the javascript function setInterval() that will trigger the next() function peridocally.

    The code I see in there isn't really built to function like that, extra controls would have to be added and logic around restarting your slideshow once it rotates to the end. Here is a quick example (untested and not ideal, but hopefully enough for you to get an idea):

    Code:
    var interval = null;
    
    function play(delay) {
        interval = setInterval(next,delay*1000);
    }
    
    function pause() {
       clearInterval(interval);
    }
    
    function next() {
        $('#rightControl').trigger('click');
    }
    
    function prev() {
        $('#leftControl').trigger('click');
    }
    
    play(3); // Start playing with a 3 second delay
    I added the pause in because starting something triggered periodically you should always give users an option to stop or pause, you'll probably want to add a design element that will give users control over playing and pausing your slideshow.
    Hi Thanks for the reply.
    If you look at this website the website which I've got the code and the last reply there is a comment with auto-slide tried that no luck
    Create a Slick and Accessible Slideshow Using jQuery
    I'm a Freelance Web Designer. Web design, That's My Passion.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •