Opening a popup with iFrame on mouseover

眉间皱痕 提交于 2019-12-12 09:59:28

问题


I'm working on this project which requires this feature. When I hover over an image, it should open a small box next to it (like tooltip) and load a link there (probably an iFrame).

 <script>
  $(function() {
    $( document ).tooltip();
  });
  </script

I tried to do this via tooltip (tried manipulating the tolltip so that it could open a small box and load an iFrame), but that didn't work as well. Due to my limited knowledge in JavaScript/ jQuery. I couldn't find any viable solution.

What should I do to make it work like require ?

Any suggestions are appreciated.


回答1:


you could do something like this

Demo

the html:

<div id="hoverMe">Hover over here</div>
<iframe id="tooltip" src="http://jsfiddle.net"></iframe>

the jQuery:

$('#hoverMe').hover(function () {
    $('#tooltip').fadeIn();
}, function () {
    $('#tooltip').fadeOut();
});


来源:https://stackoverflow.com/questions/22818815/opening-a-popup-with-iframe-on-mouseover

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