How to create a hovering pop up

2019-08-21 15:26发布

问题:

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.