Search code examples
javascripthtmlwindow

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


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.


Solution

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