Ticket #6637 (closed bug: fixed)

Opened 4 years ago

Last modified 4 years ago

Slide effect is jumpy with certain parameter combinations

Reported by: Jeff Roush Owned by:
Priority: minor Milestone: 1.8.7
Component: ui.effects.* (individual effect) Version: 1.8.6
Keywords: Cc:
Blocking: Blocked by:

Description

An example of the bug is at:  http://jsbin.com/equwu4/2/

When showing an element using the slide effect, if the direction parameter is 'left' or 'up', and the distance parameter is a non-number CSS position, like "75%", or "75px", instead of a pure number, the animation runs but starts at the wrong location and jumps when it's done. When the direction is 'right' or 'down', or the distance is a pure number, the animation is smooth.

The animation should be smooth for all valid parameter combinations.

To reproduce:

First, run the slide effect to the left, with a distance parameter that is not a simple number:

jqobj.effect('slide', {direction: 'left', mode: 'hide', distance: '75%'}, 2000);

And once the hiding is finished, call

jqobj.effect('slide', {direction: 'left', mode: 'show', distance: '75%'}, 2000);

I have a fix: Changing line 32 of jquery.effects.slide.js from

if (mode == 'show') el.css(ref, motion == 'pos' ? -distance : distance); Shift

to

if (mode == 'show') el.css(ref, motion == 'pos' ? (isNaN(distance) ? '-' + distance : -distance) : distance); Shift

adds an isNaN check for distance. With this change, the animation runs smoothly.

Change History

comment:1 Changed 4 years ago by scott.gonzalez

  • Status changed from new to closed
  • Resolution set to fixed
  • Milestone changed from TBD to 1.9

Fixed in  412d1aa.

comment:2 Changed 4 years ago by scott.gonzalez

  • Milestone changed from 1.9 to 1.8.7
Note: See TracTickets for help on using tickets.