Bug Tracker

Modify

Ticket #1566 (closed bug: fixed)

Opened 6 years ago

Last modified 15 months ago

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:
Blocking: Blocked by:

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

comment:1 Changed 6 years ago by donobrienjr

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

comment:2 Changed 6 years 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.

comment:3 Changed 6 years ago by brandon

This ticket is related to #1599

comment:4 Changed 5 years 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.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.