$('#somediv').stop(false, true)
.animate({marginLeft: '-=' + e.width() + 'px'}, options.speed, function(){ options.onNewSlide() })
e.with()
returns 640options.speed
contains 800options.onNewSlide()
contains a a custom callback function
It works fine in Firefox. But i debugged it with jQuery-Lint because it was throwing some random error in IE. Lint tells me:
When I called animate(...) with your args, an error was thrown! TypeError: c.speed is not a function { message="c.speed is not a function", more...}
You passed: [Object { marginLeft="-=640px"}, 800, function()]
and it indicates me the line i have posted. I have checked the jQuery doc, but my syntax seams ok.
Do you know what I am doing wrong?
PS: I use jQuery 1.4.2 from the Google API you can see the error here: http://meodai.ch/slider/ (I know the code is under construction, but still)
edit: I have tried to reproduce my error in a new file with just the animation: http://meodai.ch/slider/index2.html there it works very well! Now I am lost.
In your code you have:
When
options
isundefined
, this extends the jQuery object with the properties fromdefaultOptions
.Within
defaultOptions
arespeed
andeasing
properties, which overwrite jQuery's internal properties of the same names, causing the error.A safer way to combine
defaultOptions
andoptions
would be: