<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>test</title>
<meta http-equiv="Content-Type" content="text/html; charset=gbk" />
<meta name="Author" content="Sheneyan" />
<script type="text/javascript">
function initBK(){
var o = document.createElement('iframe');
o.id = 'fram_bk';
document.body.appendChild(o);
}
function popMenu(e){
var o = window.event?event.srcElement:e.target;
var p = getXY(e);
if (document.all){
if (!$('fram_bk')){initBK();}
with ($('fram_bk').style){
display='block';
top = p.y+"px";
left = p.x+"px";
height=$('menu').scrollHeight;
width=$('menu').scrollWidth;
}
}
with ($('menu').style){
display='block';
top = p.y+"px";
left = p.x+"px";
}
} function getXY(e){
var posx=0,posy=0;
if(e==null) e=window.event;
if(e.pageX || e.pageY){
posx=e.pageX; posy=e.pageY;
}
else if(e.clientX || e.clientY){
if(document.documentElement.scrollTop){
posx=e.clientX+document.documentElement.scrollLeft;
posy=e.clientY+document.documentElement.scrollTop;
}
else{
posx=e.clientX+document.body.scrollLeft;
posy=e.clientY+document.body.scrollTop;
}
}
return {x:posx,y:posy};
}
function $(id){return document.getElementById(id)}
</script>
<style type="text/css">
div#menu{display:none;position:absolute;z-index:100;background:yellow;}
iframe#fram_bk{border:0;position:absolute;display:none;z-index:0;}
</style>
</head>
<body>
<button onclick="popMenu(event)">点我看看效果</button><br />
<div id="menu">jinyike.iteye.com</div>
<select><option>这是select哦</option></select>
</body>
</html>
分享到:
相关推荐
这是关于iframe使用过程中出现的问题整理的解决方法,关于使用iframe不用单独写接口打通数据,直接把数据通过ifarme嵌套方法传递过去,使用简单方便。
解决scrollview中嵌套webview中包含iframe所导致的显示问题。
框架完美解决了iframe之间的跨域通讯。底层技术采用window.name转换代理实现
解决下拉菜单被iframe遮住问题吗,
它最常见的问题与使用iframes提供一系列的功能,其中包括: 高度和宽度大小的iframe内容大小。 作品以多个嵌套的iframe。 跨域iframe域认证。 提供了一系列的页面大小的计算方法来支持复杂的CSS布局。 检测修改DOM...
iframe 跨域访问session问题解决方法
该文档介绍了vue和普通web页面中iframe实现跨域的解决方案,解决了主页面中无法调用iframe方法的问题
iframe跨域问题:Uncaught DOMException Blocked a frame with origin解决方法
Iframe自动根据类容改变自己的大小,解决Iframe设置高度后无法缩小!拜一个高人所赐,特表示感谢!
主要处理javascript对iframe框架的处理
解决iframe去边框问题,一级边框设置的一些知识!
js控制/获取a.html中iframe加载的b.html中的iframe,很多人都以为getElementById可以直接获取,其实不行的,以上代码就解决了这个问题,js控制iframe加载页面的iframe,不过测试只在IE和火狐通过,谷歌不行,其他自...
解决使用tab布局过程中页面多次加载的问题 如果在使用easyui过程中,你使用了easyui 的tab布局,在tab布局的内容上使用的不是content,而是iframe,那么你的页面有可能多次加载了,这篇文章帮你解决问题
解决iframe跨域消息传递的问题,并且可以多个iframe间进行消息传递
NULL 博文链接:https://kennylee26.iteye.com/blog/868820
这是一个解决fixed在iframe中失效的解决案例,只要把文件放到编辑器中打开即可看到效果
iframe内容页白块及刷新白色背景问题解决,在IE6,IE9上测试通过。
首先在父页面的javascript给定义一个window.name,并赋予一个字符串值,如window.name="test",其中赋予的字符串值可以随意定义,然后在Iframe页面的Form 标签中定义target属性,并且其值也必须与之前定义的window....
iframe 与主框架相互访问例子,包含同域访问,跨域访问例子。
IFrame中Session丢失的解决办法