So I have a javascript/jquery image slider. Each slide is a <div> element, children of the div “container”. Every five seconds, the last slide slides up and the new image fades in. Simple stuff. Here’s my code:
window.onload = function start() {
slide();
}
function slide() {
var num = 0;
window.setInterval(function () {
$("#container div:eq(" + num + ")").slideUp(450);
num = (num + 1) % 4;
$("#container div:eq(" + num + ")").fadeIn(450);
}, 5000);
So, what do I need to do to add buttons that take you to the next slide and last slide?
Next:
Last: