Hey ! I’m geting an element’s width using this method:
var containerWidth = parseInt($(".progress-bar").width());
So I can do this:
if(barWidth >= (containerWidth*60)/100){
do something...
}
I’m trying to see if the child element’s width corresponds to 60% of the parent’s width, since I could’t find a method that returns the width in percentages. The problem is that the fractional part of the result of this expression (containerWidth*60)/100
returned by javascript and my calculator wasn’t equal, so I decided to convert it to Interger but it just returned a smaller fractional number.