简体   繁体   中英

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.

您可以使用fancybox之类的解决方案,我相信这就是您在寻找http://fancybox.net

如果我了解您的意思,那么有很多jquery插件可以做到这一点,例如http://lokeshdhakar.com/projects/lightbox2/

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM