Hi,
Please tell me what variable is changing on the loop so I can maybe create a if else statement. I'm not a developer so, I really need help. Here's the code
$(document).ready(function(){
$("#health").show();
$("#health").hide();
$("#billing").hide();
var arr = [
$("#pension"),
$("#health"),
$("#billing")
];
var cur = 0, nxt = 1;
function looptour(ncur){
if(ncur!=undefined) {
arr[cur].hide();
arr[ncur].show();
cur = ncur;
nxt = (cur + 1 < arr.length) ? cur + 1 : 0;
}
else {
setInterval(function() {
arr[cur].fadeOut(2000);
arr[nxt].fadeIn(2000);
cur = (cur + 1 < arr.length) ? cur + 1 : 0;
nxt = (nxt + 1 < arr.length) ? nxt + 1 : 0;
},6000);
}
}
looptour();
This is what I wanted to do... I just don't know the variable to use. Here's the idea, I have 3 buttons "1 2 3" I just want to add a class to those individual buttons 1 is for pension 2 is for health 3 is for billing
Thank you!
if() {
$("#tournums ul li:first a").addClass("num_active");
} else if() { $("#tournums ul li:eq(1) a").addClass("num_active");
} else if() { $("#tournums ul li:eq(2) a").addClass("num_active");
}