Answer the question
In order to leave comments, you need to log in
How to pass expression through .css method?
Hello.
There are, for example, 2 li elements.
I do li.length, I get 2.
And I need to write a script that would assign a width in% to other elements (children of li), which would depend on the amount of the element itself or
var breadcrumb = $( '#crumbs ul li a' );
var bradcrumbCounter = $( '#crumbs ul li' );
breadcrumb.css("width", )
Answer the question
In order to leave comments, you need to log in
breadcrumb.css({width : 100 / breadcrumbCounter.length + '%' })
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question