lundi 22 décembre 2014

.addClass() not working when using if-statement

hi i'm trying to add class by using Jquery if...

this is my code below

var i=0;

while(i<5){

var ll=$(".pages").eq(i).position().left;

console.log("ll="+ll+",i="+i);

i++;

if(ll=0){

$(".pages").eq(i).addClass("on");

};

};


Aucun commentaire:

Enregistrer un commentaire