Try using jQuery's delay()
method:
$(document).ready(function() {
$("#searchbanner").delay(2000).animate( {width: "515"}, 1500 );
});
This delays the execution of later functions for a given time; in this case, it will wait 2000 milliseconds before running the .animate()
method. More information can be found on the jQuery site.
EDIT: As one of the comments noted, part of the original problem may be the timing of when you are running your setTimeout
call; if it is during the loading of the page then the time given is relative to when the script runs, not when the page has completed its loading. By using jQuery's .ready()
method the execution waits until the entire document is completely loaded.