Skip to main content

Bug Tracker

Side navigation

#1566 closed bug (fixed)

Opened September 04, 2007 08:56PM UTC

Closed November 28, 2007 08:42AM UTC

Last modified March 15, 2012 01:44AM UTC

Negative Height and Width Properties in IE7 with animation

Reported by: donobrienjr Owned by: john
Priority: major Milestone: 1.2.2
Component: effects Version: 1.2
Keywords: negative height Cc:
Blocked by: Blocking:
Description

This may be related to (or the problem with) 1532 and some other tickets...

In IE7, the following line in jquery 1.1.4 is failing for me when I try to use easing. The problem seems to be with a negative value for z.now when the property (prop) is height (for example: prop='height' and z.now = -3.144324544).

So, essentially we are doing: elem.style.height = -3px

NOTE: the following line is from the z.a() function inside the fx() function:

y[prop] = parseInt(z.now) + "px";

Steps to reproduce...

Using http://jqueryjs.googlecode.com/files/jquery-1.1.4.js that is the 'lite' version of jQuery (I think) and the line number would be around 2372 or so

Note: I am using jQuery Easing v1.1.1 from http://gsgd.co.uk/sandbox/jquery.easing.php

1) set up animate() with the following, or similar (the critical part is having the easing argument), arguments:

$content.animate( {height:'toggle'}, {duration: 1000, easing: 'backinout'})

2) try to toggle against that, and the height (may) becomes negative, resulting in an 'illegal argument' in the IE7 browser. A negative height does not make too much sense, I guess. Essentially we are doing: elem.style.height = -3px

I have changed this code locally to circumvent the error (see below), but there are likely more situations that need to be handled by someone who knows the ins and outs better so that a more permanant solution can be found.

if(prop == "height" || prop == "width" ){
    y[prop] = Math.max(parseInt(z.now), 0) + "px";
} else {
    y[prop] = parseInt(z.now) + "px";
}
Attachments (0)
Change History (4)

Changed September 04, 2007 08:57PM UTC by donobrienjr comment:1

Intial revision. If there is anything I can do to help with the project, let me know.

Changed September 15, 2007 03:56AM UTC by john comment:2

milestone: 1.21.2.1
owner: → john
version: 1.1.41.2

Ok, things change slightly for jQuery 1.2 - but it's still an issue. I'll have to take some time to check into this.

Changed September 27, 2007 06:47PM UTC by brandon comment:3

This ticket is related to #1599

Changed November 28, 2007 08:42AM UTC by davidserduke comment:4

milestone: 1.2.11.2.2
need: ReviewTest Case
resolution: → fixed
status: newclosed

A fix has been put in for #1599 so there should no longer be an error in IE7. The "bounce" or "ease" or whatever might not be perfect but it shouldn't throw errors. If there is still a problem that isn't fixed please reopen the ticket with a new test case.