Click to See Complete Forum and Search --> : Css and JS


_Synk_
10-23-2003, 03:29 PM
I'm working on making my own set of menus for a web page, and it's been working out great. Due to the length of the list of products, I put a scrollbar on my menu div. However, I need to add submenus for the products now, and I need to remove the scrollbar to do that. The problem is, I can't make JS DOM access the overflow-y command, because it interprets it as a variable--overflow--minus variable y. I need to somehow change overflow-y to 'hide' to remove the scrollbar when a submenu pops up.

Thanks in advance

gil davis
10-23-2003, 04:30 PM
When you access a CSS attribute in JavaScript, you have to drop the "-" and capitalize the character that follows the "-".
document.getElementById("divID").style.overflowY = whatever;

_Synk_
10-23-2003, 06:13 PM
Thanks a million, man! I would never have guessed that capitalizing the next thing would fix it... so many hours and I could've just gone to webdev forums...:)