Function Call
Function Call
function show() {
var offset = $("#child").offset();
var posY = offset.top - $(window).scrollTop();
var posX = offset.left - $(window).scrollLeft();
$("#output").html("top:" + posY + ", left:" + posX);
}
show();
$(window).scroll(show);
Well I understand that
$(window).scroll(show);
means that execute the code when the window starts scrolling , but than why is that thing
show();
In the code , i don't get its relevance , what is it really doing ?
Topic Participants
gautamx07
dsvick