Quantcast
Channel: User Brett Merrifield - Stack Overflow
Viewing all articles
Browse latest Browse all 37

Variable width won't change after browser resize

$
0
0

I have two li's which, by using javascript, is the same width of a certain li. The li is fluid css so it changes according to the browser width. The li becomes the same width as the other li when I load the page.

When I resize the browser, the width of the li doesn't change until I reload the page. How can I have my li automatically resize when the browser resizes instead of changing when it loads the page?

var width = $('li.more').width();$('li.more ul li').css({'width':width+'px'});

Viewing all articles
Browse latest Browse all 37

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>