有没有一种方法可以让iframe悬停显示。
这就是我所拥有的:
<div id="sub1" onmouseover="<iframe src="$('#countdown').load('https://days.to/22-january/2017 #countdown');>some text</div>
使用jQuery!对不起,脚本很丑陋,我敢肯定,你可以做得更好:)
$('#idToHover').hover(function(){
$('#idModal').css("display", "block");
})
$('#idToHover').mouseout(function(){
$('#idModal').css("display", "none");
})
#idModal{
display: none;
}
<html>
<head>
<script
src="https://code.jquery.com/jquery-3.1.1.slim.js"
integrity="sha256-5i/mQ300M779N2OVDrl16lbohwXNUdzL/R2aVUXyXWA="
crossorigin="anonymous"></script>
</head>
<body>
<div id="idToHover"> Hello World </div>
<div id="idModal">
<iframe src="http://www.w3schools.com"></iframe>
</div>
</body>
</html>
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句