Seeking advice from someone:
Scenario: Currently, I have
<div id="breadCrumb" style="width:80%"></div>
Now, I want to update the width
to 100%
and retrieve the width in pixels on click
$('#menu_toggle').on('click', function() {
var cache = $('#breadCrumb');
cache.css('width', "100%").promise().done(function(){
console.log(cache.width());
});
});
However, I am still getting the 80%
value.
Only after clicking again do I receive the 100%
value in pixels
The concept was to wait until the CSS is applied before retrieving the new width
Any thoughts or suggestions?
Appreciate your assistance!