Skip to main content

Search and Top Navigation

#3912 closed bug (fixed)

Opened January 22, 2009 10:51PM UTC

Closed January 29, 2009 01:35PM UTC

Effects problems with non-numeric duration

Reported by: kbwood Owned by:
Priority: minor Milestone: 1.7
Component: ui.effects.core Version: 1.6rc5
Keywords: Cc:
Blocked by: Blocking:
Description

Some effects perform a calculation on the duration before proceeding with the animation, such as bounce, fold, and pulsate. However, they fail to cater for non-numeric durations, such as slow, normal, or fast. There needs to be a common function to resolve the non-numeric duration to a numeric value that can then be used without further problems. The code below is based on the jQuery 1.3 code (replace \\\\ with two vertical bars - can't seem to enter these directly).

function resolveDuration(duration) {

return (typeof duration === "number" && !isNaN(duration) ? duration :

jQuery.fx.speeds[duration] \\\\ jQuery.fx.speeds._default);

}

Attachments (0)
Change History (4)

Changed January 22, 2009 10:52PM UTC by kbwood comment:1

component: ui.coreeffects.core

Changed January 22, 2009 11:57PM UTC by kbwood comment:2

description: Some effects perform a calculation on the duration before proceeding with the animation, such as bounce, fold, and pulsate. However, they fail to cater for non-numeric durations, such as slow, normal, or fast. There needs to be a common function to resolve the non-numeric duration to a numeric value that can then be used without further problems. The code below is based on the jQuery 1.3 code. \ \ function resolveDuration(duration) { \ return (typeof duration === "number" && !isNaN(duration) ? duration : \ jQuery.fx.speeds[duration] || jQuery.fx.speeds._default); \ }Some effects perform a calculation on the duration before proceeding with the animation, such as bounce, fold, and pulsate. However, they fail to cater for non-numeric durations, such as slow, normal, or fast. There needs to be a common function to resolve the non-numeric duration to a numeric value that can then be used without further problems. The code below is based on the jQuery 1.3 code (replace \\\\ with two vertical bars - can't seem to enter these directly). \ \ function resolveDuration(duration) { \ return (typeof duration === "number" && !isNaN(duration) ? duration : \ jQuery.fx.speeds[duration] \\\\ jQuery.fx.speeds._default); \ }

Changed January 23, 2009 11:49AM UTC by paul comment:3

milestone: TBD1.6

Changed January 29, 2009 01:35PM UTC by paul comment:4

resolution: → fixed
status: newclosed

Fixed in r1853.