www.webdeveloper.com
Results 1 to 2 of 2

Thread: css slide using javascript

  1. #1
    Join Date
    Jul 2013
    Posts
    1

    css slide using javascript

    Hi,
    i was trying to make a slide, and make that when i press a link that is in the slide, it would go until it reaches that page !
    i tried to do so with the following code:

    function slideTo(i){

    var currslider = checkSlider();
    for (;currslider != i{
    if (currslider == 1){
    setTimeout(slideNext(),1000);
    currslider = 2;
    }else if (currslider == 2){
    setTimeout(slideNext(),1000);
    currslider = 3;
    }else if (currslider == 3){
    setTimeout(slideNext(),1000);
    currslider = 4;
    }else if (currslider == 4){
    setTimeout(slideNext(),1000);
    currslider = 1;
    }
    }
    }

    but it did not work, instead it only slides once forward !
    the checkslider() and slidenext() functions are working, i just cant make it slide all the way !
    i inserted the timeout cause i thought the code could be running and not having the time to update in the css, but even with that it blocks after 1 slide!

  2. #2
    Join Date
    Jun 2008
    Posts
    106
    setTimeout(slideNext(),1000);
    You need to do it like this:
    setTimeout(slideNext,1000);

Thread Information

Users Browsing this Thread

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

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