jquery help needed - creating automatic slideshow -
I have some code that generates pre / next buttons, and through a group of images using the next two functions Will be cycling photo and photo shoot I was wondering if someone could turn me this code into automatic slideshow?
Here's my code:
$ max = 8; $ Current = 1 function next photo () {if ($ current! = $ Maximum) {$ ('slider' + ($ current) + ''). Hide (); $ ('. Slider' + ($ Current +1) + '') Show ().; $ ('. Slider' + ($ current + 1 + ') +' '). CSS ('left', '20% '); $ ('. Slider' + ($ current + 1 + ') +' '). Animate ({left: '0%'}, {duration: 500, easy: "easeOutExpo", line: wrong}); ResizeImages (); $ Current ++; } If ($ current == 2) {$ ('# background. Left'). Animate ({left: '0px'}, {duration: 600, easing: "easeOutExpo", line: false}); } If ($ current == $ max) {$ ('# background .right'). Animate ({true: '- 85px'}, {duration: 600, easy: "easeOutExpo", line: wrong}); Set interval ("restart slides ()", 5000); }} Function prevPhoto () {resizeImages (); If ($ current! = 1) {$ ('. Slider' + ($ current) + ''). Hide (); $ ('. Slider' + ($ Current -1) + '') Show ().; $ ('. Slider' + ($ current -1) + ''). CSS ('left', '-20%'); $ ('. Slider' + ($ current -1) + ''). Animate ({left: '0%'}, {duration: 500, easy: "easy option", line: wrong}); ResizeImages (); $ Current -; } If ($ current == 1) {$ ('# background. Left') Animate ({left: '- 85px'}, {duration: 600, easy: "easeOutExpo", line: wrong}); } If ($ current == $ max -1) {$ ('# background .right'). Animate ({right: '0px'}, {duration: 600, easy: "easeOutExpo", line: wrong}); }} $ ('Right') mouseup (function () {nextPhoto ();}) $ ('. Left'). Instead of writing your own, I have found this pre-available and widely available form for jQuery () () (function () ()
Comments
Post a Comment