How to create a hovering pop up

僤鯓⒐⒋嵵緔 提交于 2020-01-06 21:22:10

问题


I would like to have a link on my site that when you click it a site segment that hovers above the content appears and displays some information until it is closed in some way, and I would like to be able to insert anything I want to in there- text, images, CSS formatting, etc.

What language should I use for this? Do you know any sites that do this? Also a link to relevant libraries would be appreciated.


回答1:


javascript is used for such client side tasks such as this. The library jquery will be imensensly helpful. Basically what happens is when you hover your mouse over an image (or whatever you like) a div gets its display property switched and is positioned at the appropriate coordinates. Since this is a div, you can insert into it anything you would have in a webpage, images, CSS, flash, or whatever you like.




回答2:


If I understand well the requirements, you need to use JavaScript, <div>s and the CSS property "display".




回答3:


Check out Prototype Window Xilinus. They have exactly you're looking for.



来源:https://stackoverflow.com/questions/1165797/how-to-create-a-hovering-pop-up

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!