The way I have my site setup is that I have a grid of thumbnails that is sized based on the user's screen resolution and also has a scrolling mechanism in it. Another feature I'm trying to add is the ability to click on a thumbnail and have the image you clicked appear in the center of the screen at full size (or as close to full size as possible without going off the screen) on top of a black transparent overlay. I realize there are plug-ins for this but I'm attempting to do my own for the sake of learning and familiarity.
Here's what I have so far.
$('a.cell').click(function() {
$('<div id = "overlay" />').appendTo('body').fadeIn("slow");
var src = $('img', this).attr("src");
});
This function is meant to apply the overlay to the entire page, which it does just fine, and then retrieve the path of the image from the thumbnail the user clicks on. The thumbnails are 'img' tags which are children of 'a' tags with the class of 'cell', they are sized at 100x100 and the 'src' is the path to the actual image. I don't have any separate thumbnails or resizing/resampling mechanism just yet but it's something I plan to add later. After this part I find myself stuck what to write next. The image needs to go to the center of the page, fade in and be sized such that it is either its full size or as close as it can be without running over the boundaries of the browser. Another important feature I'm trying to implement is to have a loading animation in the center of the screen that stays until the image is ready to be shown and goes away when it's no longer needed.