HELP!!! How do I set a div width through the onresize event?
I am trying to set a div width through the onresize event. For some reason, I am able to set the height ok. When setting the width, it will set once and then both the height and the width will not respond to the onresize event anymore. I basically want the div to resize whenever the browser is resized.
To demonstrate what I mean, copy and paste this code into a htm file. Add long strings of text to the div so that it will scroll both horizontally and vertically. Notice when resizing, the resize will get called once, but when resizing again it will not. Comment out the width line, and now the resizing will always get called.
I'm no JS expert, but the only way I've seen this work is if you refresh the page on resize and have that code in the head of the page. I may be wrong since I don't meddle in these things very often, but I have a script that does something similar. I pain, granted, but it works.