#1566 closed bug (fixed)
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"; }
Change History (4)
comment:1 Changed 15 years ago by
comment:2 Changed 15 years ago by
Milestone: | 1.2 → 1.2.1 |
---|---|
Owner: | set to john |
Version: | 1.1.4 → 1.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.
comment:4 Changed 15 years ago by
Milestone: | 1.2.1 → 1.2.2 |
---|---|
need: | Review → Test Case |
Resolution: | → fixed |
Status: | new → closed |
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.
Intial revision. If there is anything I can do to help with the project, let me know.