Help with onload and timeout

Hello,
I was wondering if someone could please help me write some javascript that a few seconds, let us say 4, after the window loads, a div tag fades in or appears.
I know how I could fade it out, and fade it upon a triggered action in jQuery, but how would i do it after a certain time has passed in javascript or jQuery

I did some reading on setTimeout, a funciton I was not familiar with in javascript but I was wondering if someone could help me with this part so that I can understand it for future code :slight_smile:

My idea for possible syntax would be something like

window.onLoad{
setTimeout(
function(){
#gbar.fadeIn();,
4000
)};

Thanks in Advance and Best Regards,
Team 1504

Almost correct, just reshuffle some accolades and parentheses ( and change window.onLoad to $(window).load ):

$(window).load( function() {
  setTimeout( function() {
    $("#gbar").fadeIn();
  }, 4000 );
});