The code I created works but if you click on de buttons quickly the slider is hooked.
Jquery
$(document).ready(function(){
$(".list div").each(function(e) {
if (e != 0)
$(this).hide();
});
$("#next").click(function(){
if ($(".list div:visible").next().length != 0){
$(".list div:visible").stop().next().stop().fadeIn().prev().stop().fadeOut();
} else {
$(".list div:visible").fadeOut();
$(".list div:first").fadeIn();
}
return false;
});
$("#prev").click(function(){
if ($(".list div:visible").prev().length != 0){
$(".list div:visible").prev().stop().fadeIn().next().stop().fadeOut();
} else {
$(".list div:visible").fadeOut();
$(".list div:last").fadeIn();
}
return false;
});
});
Whats wrong with this code?
Hope somebody can help me.
Greets Yoeri