I created a basic lightbox like thing, when a thumbnail is clicked, a popup window appears. How can I detect the top position with jQuery, so when the popup div appears it's always e.g. 200px from the window's top?
$('#thumbs img').click(function(){
$('.popup').fadeIn(300);
$('#dark-overlay').fadeIn(300);
});
$('#dark-overlay').click(function(){
$(this).fadeOut(300);
$('.popup').hide();
});
Example: http://jsfiddle.net/EXT4H/1/