#6637 closed bug (fixed)
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: | ||
Blocked by: | Blocking: |
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 (2)
comment:1 Changed 12 years ago by
Milestone: | TBD → 1.9 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
comment:2 Changed 11 years ago by
Milestone: | 1.9 → 1.8.7 |
---|
Fixed in 412d1aa.