Function Call

Function Call

  1. function show() {
  2.     var offset = $("#child").offset();
  3.     var posY = offset.top - $(window).scrollTop();
  4.     var posX = offset.left - $(window).scrollLeft();
  5.     
  6.          $("#output").html("top:" + posY + ", left:" + posX);
  7.    
  8. }

  9. show();
  10. $(window).scroll(show);


Well I understand that 
  1. $(window).scroll(show);

means that execute the code when the window starts scrolling , but than why is that thing 

  1. show();
In the code , i don't get its relevance , what is it really doing ?