Skip to main content

Bug Tracker

Side navigation

#3599 closed bug (invalid)

Opened November 13, 2008 10:22AM UTC

Closed November 13, 2008 03:08PM UTC

animate: "val is undefined" when animating to an appended element

Reported by: Okko Owned by:
Priority: major Milestone: 1.3
Component: effects Version: 1.2.6
Keywords: fx.js fx animate undefined appended element append scrollTo Cc: flesler, Okko
Blocked by: Blocking:
Description

The fx.js's animate function does not check that the propertys value is defined before calling its toString method.

52 animate: function( prop, speed, easing, callback ) {

..

79 jQuery.each( prop, function(name, val){

..

85 var parts = val.toString().match(/^([+-]=)?([\\d+-.]+)(.*)$/),

Test case:

http://www.frantic.com/okko/jquery/bug-scroll/

It will produce

"val is undefined

var parts = val.toString().match(/^([+-]=)?([\\d+-.]+)(.*)$/),"

Attachments (0)
Change History (3)

Changed November 13, 2008 02:46PM UTC by flesler comment:1

cc: fleslerflesler, Okko

The test case says:

$('div class="....

You're missing the opening <.

Changed November 13, 2008 02:58PM UTC by Okko comment:2

That is true, adding it fixed the error. Thank you.

Should we close this bug or should jQuery be improved so that it can cope with this?

Changed November 13, 2008 03:08PM UTC by flesler comment:3

resolution: → invalid
status: newclosed

Nope. It's not a bug, just a typo.

The html string that you give jQuery must be valid xhtml.