Javascript/CSS Display Issue
By: Keith Watanabe
Published On: 3-6-2008
I ran into a rather frustrating problem that I only solved the other day. It was that I had embedded a stylesheet within the HTML using the style tags. Inside, I used the ID selector to style a particular div element. In particular, I used a kind of display: none; thing.
Well, one of the things I needed was to be able to make that part visible again once a person unchecked that element. Before I was doing something like $(ele).style.display = '';. Turns out, that the precedence of Javascript is lower than the one in inline style. So to rectify this, I had to instead do $(ele).style.display = 'block' (or inline). Pretty annoying but a nice little fix to this problem.
Post Comment
Trackbacks: (Trackback URL)
No Comments Posted Yet
