Here is slideshow script and in Firefox alone it is not working, it is working in IE and chrome, can you see what the issue is
i am getting id not defined at "
"
Any help is greatly appreciated.
i am getting id not defined at "
Code:
setInterval('slideShow(' + divId + ')', 3000);
Code:
$(document).ready(function() {
$('.heroBanner').each(function(index) {
var $divObject = $(this);
show($divObject);
});
});
//Slides starts from from 0 index.
function show(currentDiv) {
currentDiv.find("ul.carausalWrapper li").eq(0).addClass("activePro");
currentDiv.find("div.pagination ul li").eq(0).find("a").addClass("active");
var divId = currentDiv.attr('id');
//alert(divId);
setInterval('slideShow(' + divId + ')', 3000);
}
//Slides the images based on the slide interval.
function slideShow(currentDivId) {
//alert(currentDivId);
var $divObject = $(currentDivId);
var $active = $divObject.find("ul.carausalWrapper li.activePro");
var $pageActive = $divObject.find("div.pagination ul li a.active");
var $inx = $divObject.find("ul.carausalWrapper li.activePro").index();
var $elemLength = parseInt($divObject.find("ul.carausalWrapper li").length) - 1;
var $next = 0;
$active.removeClass('activePro');
$pageActive.removeClass('active');
if ($inx < $elemLength) {
$next = parseInt($inx) + 1;
}
if ($inx == $elemLength) {
$next = 0;
}
$divObject.find("ul.carausalWrapper li").eq($next).addClass("activePro");
$divObject.find("div.pagination ul li").eq($next).find("a").addClass("active");
}
Comment