/    Sign up×
Community /Pin to ProfileBookmark

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!

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@tenfoldJul 30.2013 — setTimeout(slideNext(),1000);[/QUOTE]

You need to do it like this:

setTimeout(slideNext,1000);
×

Success!

Help @mariogonxalo spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...