$(document).ready(function () { { $(".Prev").css({ "position": "fixed", "top": "203px", "left": "74px", "width": "65px", "height": "65px", "background-image": "url(/HoshITC/images/prev.png)" }); $(".Next").css({ "position": "absolute", "left": "867px", "top": "200px", "width": "65px", "height": "65px", "background-image": "url(/HoshITC/images/next.png)" }); } var counter = 0; var slideCount = $(".slides>li").length; var sliderTimer; $(".slides>li").each(function () { //debugger; counter += 1; $(this).attr("id", "slide" + counter); }); function hideAllSlides() { $(".slides>li").css("display", 'none'); } function resetTimer() { clearInterval(sliderTimer); sliderTimer = setInterval(function () { counter += 1; if (counter > slideCount) counter = 1; hideAllSlides(); $(".slides #slide" + counter).fadeIn(); }, 2000); } $("#Next").click(function () { debugger; counter += 1; if (counter > slideCount) counter = 1; hideAllSlides(); $(".slides>li" + counter).fadeIn(10); }); $("#Prev").click(function () { counter -= 1; if (counter < 1) counter = slideCount; hideAllSlides(); $(".slides>li" + counter).fadeIn(10); //resetTimer(); }); hideAllSlides(); counter = 1; $(".slides li:eq(1)").show(); resetTimer(); });
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)