Q:

jquery popup time delay

My This following script open popup box when page load . all Working fine But it loading immediately when page loading . i need add time delay function i want open popup after 5 seconds
$(function() {
  setTimeout(function() {

    var overlay = $('<div id="overlay"></div>');
    overlay.show();
    overlay.appendTo(document.body);
    $('.popup').show();
    $('.close').click(function() {
      $('.popup').hide();
      overlay.appendTo(document.body).remove();
      return false;

    });

    $('.x').click(function() {
      $('.popup').hide();
      overlay.appendTo(document.body).remove();
      return false;
    });

  });
}, 3000);

A:

You can use the setTimeOut function:
setTimeout(function(){ /** do what you want after 3 seconds */ }, 3000);

In your case you can use it like this:
$(function(){
    setTimeout(function(){ /** do what you want after 3 seconds */ }, 3000);
});

