dcsimg
www.webdeveloper.com
Results 1 to 4 of 4

Thread: Jquery slideshow

  1. #1
    Join Date
    Apr 2009
    Posts
    33

    Exclamation Jquery slideshow

    Here's my code, it's not working, not sure what I did wrong

    <div id="slideshow" style="width:240px; height:200px; overflow:hidden;">
    <img src="1.jpg" />
    <img src="2.jpg" />
    <img src="3.jpg" />
    <img src="4.jpg" />
    </div>
    </div>
    <br />
    <button id="start">Start</button>
    <button id="stop">Stop</button>
    <script>

    var slide;

    function startShow()
    {
    slide=setInterval(function(){

    $('#start').click(startShow() {
    $('#slideshow').mouseenter();

    $('#slideshow img:first').appendTo('#slideshow');

    }); $('#slideshow').mouseleave(function() {
    $('#slideshow').stop();

    }); $('#slideshow').click(stopShow() {
    $('#stop').stop();
    });
    },2000);
    }

    function stopShow()
    {
    clearInterval(slide);
    }

    </script>

  2. #2
    Join Date
    Apr 2009
    Posts
    33
    I've made some progress, but still not there. My clearInterval isn't working, but when I comment it out, the rest of the code works fine.


    <div id="slideshow" style="width:240px; height:200px; overflow:hidden;">
    <img src="1.jpg" />
    <img src="2.jpg" />
    <img src="3.jpg" />
    <img src="4.jpg" />
    </div>


    <script>

    var slide

    function startShow()

    {
    $('#slideshow').hover(

    function() {

    slide = setInterval(function(){
    $('#slideshow img:first').appendTo('#slideshow');
    }, 2000);

    function() {
    clearInterval(slide);
    });

    });
    }

    startShow();

  3. #3
    Join Date
    Oct 2012
    Posts
    8
    Is it important for you to create the jQuery slideshow yourself or can you use a plugin? I use jQuery slideshow plugin, no programming needed and the images are hosted outside my website (so the images are loaded really fast). Maybe you should try it

  4. #4
    Join Date
    Oct 2012
    Posts
    10
    Quote Originally Posted by Webdev22 View Post
    Is it important for you to create the jQuery slideshow yourself or can you use a plugin? I use jQuery slideshow plugin, no programming needed and the images are hosted outside my website (so the images are loaded really fast). Maybe you should try it
    Although the fastness of the loading time is an advantage, there is also a huge disadvantage and that is that you're dependent on the other website. If that website encounters errors, going down for maintenance etc, your images won't load as well.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles