Friday, November 21, 2008

MooTools slide effect and Internet Explorer CSS

Have you struck a problem with MooTools slide transition and CSS styles not appearing correctly in IE? I ran into this exact issue the other day where I was trying to slide a DIV element up and down based on a click event elsewhere on the page. The CSS style applied to the DIV looked something like this:

#slidingDiv {
    padding-bottom: 10px;
    background: white url(../images/box_bottom.gif) bottom no-repeat;
}
The problem seems to be that IE can't calculate the height of content in the dynamically resized DIV correctly and thus the padding-bottom and hence my background image (nice rounded corners in this case) wasn' showing.

The solution


The fix turned out to be simple enough, I just made the height of the DIV fixed in the CSS. Once IE knew how big the inner content was supposed to be everything started working correctly.

Labels: , , ,

0 Comments:

Post a Comment

<< Home