On Jun 11, 3:50 pm, John Resig <jere...@gmail.com> wrote:
> This is due to the issue where if an element has a height or width
> equal to 0, in IE in quirksmode, the full height/width of the element
> is shown.

I'm aware of the issue, it has been around for a long time...

> jQuery use to have a fix for this - anytime a value of 0 was
> set a value of 1 was set instead - unfortunately this caused other
> strange side-effects with other browsers so it became preferable to
> require that the page not be in quirksmode.

This is the leap of logic that doesn't seem rational to me. Instead of
finding a better fix, you throw out common functionality in a huge set
of pages on the web? I don't like the approach that jQuery seems to
take too often - If a problem proves to be too tricky or a browser is
just a pain to support, just declare that feature or browser
unsupported! That seems lazy to me in a library that is suppose to
normalize browser behavior, not toss out those that don't normalize
easily. Especially when the browser is the most common on the web, and
in quirksmode which is also still a very common environment.

> Now, we could feature detect this bug occurring (which is obviously
> possible, as shown in the test case) and only do the "set 1 only, not
> 0" in browsers that have that specific problem - however that creates
> the situation where Internet Explorer in quirksmode will have a
> completely different style of animation (at least one that is, still,
> only fixable by pushing your page out of quirksmode).

How would it be completely different?

I put this fix in the page where I needed this effect:

jQuery.fx.prototype.originalCustom = jQuery.fx.prototype.custom;
jQuery.fx.prototype.custom = function(from,to,unit) {
        if (this.prop=='height') {
                to = to || 1;
                from = from || 1;
        }
        this.originalCustom(from,to,unit);
}

> As always, a patch with a better solution for this problem would
> certainly be welcome.

Just don't animate height to/from 0 as long as the units are px -
always use 1 instead. I can't think of why this would be a problem in
any browser, would it?

Matt Kruse

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to jquery-dev@googlegroups.com
To unsubscribe from this group, send email to 
jquery-dev+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to