How to show live preview in a small popup of linked page on mouse over on link?

匿名 (未验证) 提交于 2019-12-03 02:45:02

问题:

How to show live preview in a small popup of linked page on mouse over on link ?

like this

http://cssglobe.com/lab/tooltip/03/

but live preview

回答1:

You can use an iframe to display a preview of the page on mouseover.

http://jsbin.com/urarem/3/edit

HTML:

This live preview for Wikipedia
remains open on mouseover.

CSS:

.box{     display: none;     width: 100%; }  a:hover + .box,.box:hover{     display: block;     position: relative;     z-index: 100; } 

Here's an example with multiple link previews.



回答2:

You can display a live preview of a link using javascript using the code below.

Learn more about it at Codegena

id="p1" - Fetch image preview on page load. id="p2" - Fetch preview on hover. id="p3" - Fetch preview image each time you hover. 


回答3:

I have done a little plugin to show a iframe window to preview a link. Still in beta version. Maybe it fits your case: https://github.com/Fischer-L/previewbox.



回答4:

Another way is to use a website thumbnail/link preview service LinkPeek (even happens to show a screenshot of StackOverflow as a demo right now), URL2PNG, Browshot, Websnapr, or an alternative.



回答5:

You could do the following:

  1. Create (or find) a service that renders URLs as preview images
  2. Load that image on mouse over and show it
  3. If you are obsessive about being live, then use a Timer plug-in for jQuery to reload the image after some time

Of course this isn't actually live.

What would be more sensible is that you could generate preview images for certain URLs e.g. every day or every week and use them. I image that you don't want to do this manually and you don't want to show the users of your service a preview that looks completely different than what the site currently looks like.



回答6:

Personally I would avoid iframes and go with an embed tag to create the view in the mouseover box.



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