سؤال

I have a class defined var "bar" attributed to a certain div with no ID nor CLASS.

bar.style.width = progress+"%";

Is there a way I can make "bar" var div animate using jquery?

.animate({width:progress+"%"},90);
هل كانت مفيدة؟

المحلول

bar looks like a dom element reference... you need to get the jQuery object to call animate(...)

so

$(bar).animate({width:progress+"%"},90);
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top