IE6 css display bug with javascript

If you are trying to set an image to display = ‘block’; or display = ‘none’; in IE when the default setting is none (you set the element to not display when the page loads), you are not going to be able to make it visible again. Wait..? Visible?!  Actually, that’s the answer, use visibility = ‘hidden’; and visibility = ‘visible’; and you will almost always get the effect you were looking for with the display property.

With the name “display”, it is sort of misleading but what the display property is actually doing is specifying to your browser what type of element the selected element is.  There are different kinds of elements, inline, block, etc. and they all have different behaviors and can have different properties applied to them in your browser.  Display can be used to convert elements from one type to another.  An inline element such as a list item <span>, which cannot be absolutely positioned can be converted to a ‘block’ element and positioned as if it were a div though, this is hardly ever necessary unless you are working with javascript effects libraries such as mootools or jQuery.

2 Responses to “IE6 css display bug with javascript”

  1. Khalid Majid Says:

    Thanks a lot buddy, I’d been searching a fix for IE-6’s display: none bug for quite some time. You really helped me out.

    I was using the ‘display: none;’ style at my website’s main menu, you’ve solved my problem. To checkout the result of your tip just visit the link in your form’s website field.

    I’ll be sure to mention you tip to others and credit you at my site for your help. :)

    Regards,

    RaceX

  2. Jason Chuh Says:

    Thank you very much.
    I use display:inherit,and there is ok in firefox,but ie6 is not active. I change it with display:block ,and it work.

Leave a Reply

watch free movies online download movies online free movies online