jQuery: The Write Less, Do More JavaScript Library

Ticket #1607 (closed bug: fixed)

Opened 1 year ago

Last modified 11 months ago

It's not possible to animate an element to an absolute negative position.

Reported by: gensmann Assigned to: john
Type: bug Priority: major
Milestone: 1.2.1 Component: fx
Version: 1.2 Keywords:
Cc: Needs: Review

Description

It's not possible to animate an element to an absolute negative position.

The new -/+ function in 1.2 for putting the animator into relative mode seems to affect when I wants to something like .animate({left: -1337}) and I don't whant to move it relative to the current position, but simple wants to move it to the position of left:-1337px.

in a specific example I want to move a container with the following code:

jQuery('.ghe_header_button', $areaHeader).each(function(index) {

jQuery(this).click(function() {

jQuery('div', $areaSlideContainer).css('overflow', 'hidden'); $areaSlideContainer.animate({left: $areaContainer.width() * index * -1}, 1500, 'swing',function(){

jQuery('div:eq('+ index +')', $areaSlideContainer).css('overflow', 'auto');

})

});

});

When I do it by using * -1 it switches to relative mode, however if I remove the * -1 part it moves it (forward) using absolute mode.

Attachments

Change History

Changed 1 year ago by sunsean

I've just committed this fix to SVN. Revision 3721

Changed 1 year ago by gensmann

Seems like the fix isn't quite fixing it. Now it basically always does a positive absolute movement. Even if I throw -700 after it, it moves to the right. However it does it correct absolute now. It just seems like it don't know the difference between a postive and a negative integer and treats all as a positive?

Changed 1 year ago by sunsean

Right you are, completely blew that by me. If this doesn't work I shall resign. Revision 3272

Changed 1 year ago by john

  • owner set to john

Changed 11 months ago by john

  • status changed from new to closed
  • resolution set to fixed

Converted to the new -= / += format in SVN rev [3299].

Changed 11 months ago by john

  • component changed from core to fx
Note: See TracTickets for help on using tickets.