creating a pop-up(or is it a pop-over?) window for a webpage

622 views Asked by At

I do apologize for the title if it is inaccurate. (feel free to offer me suggestions on the proper wording if needed.)

My question is for my web page, I would like to do something where you click on a link (or image), and instead of opening a new tab or browser window, you get a box that hovers over your page displaying the image of the link (or smaller image you clicked on). I am not sure if the correct term for this is a pop-up or pop-over window.

The best example of what I would like to do, is if you were to go to amazon.com and you see a product and it says "click here for a larger image". when you do that, a sort of window will display itself over the current page and show you the larger image.

Would anyone be able to give an example of code to see how this would be done as well? I am very thankful for any and all recommendations.

3

There are 3 answers

0
josedefreitasc On BEST ANSWER

You could use a solution like fancybox, I believe this is what are you looking for http://fancybox.net

0
GUL On

If I've understood what you mean, there are tons of jquery plugins to do that, for example http://lokeshdhakar.com/projects/lightbox2/

0
Adam Buchanan Smith On

Here is a link, he has an explanation and code snippets for ya, works great.

http://www.htmlgoodies.com/beyond/javascript/article.php/3881276