Bug Tracker

Opened 14 years ago

Closed 14 years ago

#3599 closed bug (invalid)

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:


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+-.]+)(.*)$/),"

Change History (3)

comment:1 Changed 14 years ago by flesler

Cc: Okko added

The test case says:

$('div class="....

You're missing the opening <.

comment:2 Changed 14 years ago by Okko

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?

comment:3 Changed 14 years ago by flesler

Resolution: invalid
Status: newclosed

Nope. It's not a bug, just a typo. The html string that you give jQuery must be valid xhtml.

Note: See TracTickets for help on using tickets.