A simple question: Why can I do this
var start = function() {
$(\'#element\').animate({}, 5000, \'linear\', start);
}
but not this
In your second function you are executing the function instead of passing a reference to the function, hence it's going into an infinite loop.
Change your second function from:
function start() {
$('#element').animate({}, 5000, 'linear', start());
}
to
function start() {
$('#element').animate({}, 5000, 'linear', start); //Notice the change to start
}