nameitself
10-03-2006, 08:18 PM
I'm trying to create a div, with appendChild, which has an attribute in the css that renders it essentialy invisible.
For example:
.inv{ display:none; }
or
.inv{ height:0px; overflow:hidden; }
Then, after creating the div, change the attribute(s) so as to make it visible.
So far, useing an "elem.style.height" type of method doesnt seem to effect the attribute set in the css. Changing the class name to a class where the element has visible attribute(s) doesnt seem to work either, as it does not seem to override the previously set attributes.
I made a little animation for revealing the contents of a div that had been created this way. But what I've been doing is creating the div, then setting it's attributes to make it invisible then slowy making it visible again. this works fine most of the time, but sometimes there's this anoying flicker where you can see the div before it's set to it's invisible state. I'm trying to find a good way to fix this problem without doing anything like setting the div's position to 1000px off the screen or some other "crackish" method.
Also, I'd like to not have to walk through the style rules, seeing as how that method seems like a bad idea if you're going to be updating your css regularly.
Thanks for any and all advice.
For example:
.inv{ display:none; }
or
.inv{ height:0px; overflow:hidden; }
Then, after creating the div, change the attribute(s) so as to make it visible.
So far, useing an "elem.style.height" type of method doesnt seem to effect the attribute set in the css. Changing the class name to a class where the element has visible attribute(s) doesnt seem to work either, as it does not seem to override the previously set attributes.
I made a little animation for revealing the contents of a div that had been created this way. But what I've been doing is creating the div, then setting it's attributes to make it invisible then slowy making it visible again. this works fine most of the time, but sometimes there's this anoying flicker where you can see the div before it's set to it's invisible state. I'm trying to find a good way to fix this problem without doing anything like setting the div's position to 1000px off the screen or some other "crackish" method.
Also, I'd like to not have to walk through the style rules, seeing as how that method seems like a bad idea if you're going to be updating your css regularly.
Thanks for any and all advice.