Bug Tracker

Ticket #1566 (closed bug: fixed)

Opened 1 year ago

Last modified 9 months ago

Negative Height and Width Properties in IE7 with animation

Reported by: donobrienjr Assigned to: john
Type: bug Priority: major
Milestone: 1.2.2 Component: fx
Version: 1.2 Keywords: negative height
Cc: Needs: Test Case

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

Change History

Changed 1 year ago by donobrienjr

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

Changed 1 year ago by john

  • owner set to john
  • version changed from 1.1.4 to 1.2
  • milestone changed from 1.2 to 1.2.1

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 1 year ago by brandon

This ticket is related to #1599

Changed 9 months ago by davidserduke

  • need changed from Review to Test Case
  • status changed from new to closed
  • resolution set to fixed
  • milestone changed from 1.2.1 to 1.2.2

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.

Note: See TracTickets for help on using tickets.