I'm new to JavaScript and jQuery, I know HTML & CSS rather well.
I have a page of 20 minimised pictures (soon to be 500+ images) that when clicked are opened into a new page.
I am having no issues there. What I would like is when a picture is clicked it is opened in an already styled page and the selected picture is placed in the center of that page (or where ever I would like it placed).
I know I must need to carry the picture id to the new page, but I am completely lost as to what code to use. Here is what I am using right now to get to the new page.
<img src="img/1.jpg" class="thumbnail" id="preview">
and to get this image to open in a new window I am using
<script>
$(document).ready(function() {
$('img.thumbnail').click(function() {
window.location.href = this.id + '.html';
});
});
</script>
This code opens the image in another window but it is not styled, I would like to have it styled and have any image that is selected placed where I select it to be.
I don't want to create 500+ pages for each image and I know I have seen it done, I just don't know how to do it.
Thank you for any assistance that can be offered.