#14644 closed bug (notabug)
Animation speed depending on duration variable type
Reported by: | anonymous | Owned by: | |
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | unfiled | Version: | 1.10.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Hi all
I made a small example of a problem that I've hit for the second time; and I wanted to document it once more. I create a small jsfiddle which hopefully shows what I mean. I reported the same bug a year ago and unfortunately it was negated.
http://jsfiddle.net/Z8eNH/10/ http://bugs.jquery.com/ticket/13273
As I already knew this bug I had no problem to fix it, but I'm very curious if I'm really the only one to hit this twice; or if I'm so wrong about it's solution (see earlier bug report)!
If so, I shall be quiet and accept to need to convert numbers to actual number types, no matter where they've come from for animation durations!!!
Best regards
Change History (5)
comment:1 Changed 10 years ago by
comment:2 Changed 10 years ago by
I can't see the bug here. It works like documented. Duration requires a number or a string. If it is a string, you have to put in 'fast' or 'slow'. If you give anything else, it will fall back on it's default value of 400 ms. A string of '2000' is not a valid value.
comment:3 Changed 10 years ago by
Resolution: | → notabug |
---|---|
Status: | new → closed |
Agreed. If the value is a string it's a shorthand name and goes through the lookup like "slow".
comment:4 Changed 10 years ago by
Thanks for taking another look at it. Just wanted to leave a short reply. window.setTimeout also accepts numbers in the form of a string. So for me it would feel naturaly if jQuery.animate duration would too. IMO it would not interfere with the current behaviour. At least I'd think this would be worth documenting. I know that most of the time the duration will be set somewhere in the code (thus beeing a true number type). I keep stumbling up on this one whenever I create a UI to test my js stuff; where I want to set the duration via an input field or a prompt.
Bye and Happy Holidays!
comment:5 Changed 10 years ago by
I'd think this would be worth documenting
I agree. You should open an issue at https://github.com/jquery/api.jquery.com/issues?state=open - that's where documentation bugs are filed.
Sorry, some naming mistakes -> corrected demo version: jsfiddle.net/Z8eNH/12/