Skip to content
Advertisement

How to change animated status bar value with same class but different part

I do need for these status bars to work for each own. Maybe also the buttons could worked. I tried to acquire the value of “data-bar” without succeed (the script does still can process the “data-max”). And seems that the script does apply to all bars, not individually, while I need that it differs for each bar.


In html:

JavaScript

In script:

JavaScript

In css:

JavaScript

Advertisement

Answer

You can use each loop to iterate through your divs and get required values i.e : attributes then use $(this).find("someclass") to get reference of divs where you need to change widths and texts.

Demo Code :

JavaScript
JavaScript
JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement