I have an array of numbers and currentValue array values dynamically changes if same values animate ( fade-in and fade-out ) the Tooltipclass elements but its not working.
check currentValue array then get the same value index if i get index 0 and 3 are same value and animate the Tooltipclass index 0 and 3 element.
JS:
eg: var currentValue = [3,5,3];
// index 0 and 2 same values
var Tooltipclass = ['.helpertool_1','.helpertool_2','.helpertool_3'];
// class index 0 and 2 ll animate
JS:
function getSamevalue(values){
var currentValue = [3,5,3]; //[values] dynamically values ll change
var Tooltipclass = ['.helpertool_1','.helpertool_2','.helpertool_3'];
$.each(Tooltipclass, function(i, val) {
setTimeout(function() {
$(Tooltipclass[i]).fadeOut("slow", function() {
$(this).fadeIn("slow");
});
}, i * 3000);
});
}
getSamevalue(values);
CSS:
.tooltip{ background: red;position:absolute; width:50px; height:20px; }