导航
Index
Search
TagCloud
GuestBook
风萧萧兮易水寒, 壮士一去兮不复还。
« 客齐集过河拆桥,将关闭所有频道订制网站
什么是子目录绑定 »
完美的AJAX定位解决方案
2008年7月30日 11:19:30 发布:清风
完美的AJAX定位解决方案
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <script type="text/javascript"> //coding by 清风 //QQ: 21684883, MSN: anwellsz@msn.com //Last Modify : 07/30/2008 //获取当前窗口位置的高度 function getHeight(){ var t,h; if (document.documentElement && document.documentElement.scrollTop) { t = document.documentElement.scrollTop; h = document.documentElement.scrollHeight; }else if (document.body) { t = document.body.scrollTop; h = screen.height; } return h + t; } function openWithIframe(tit,url,w,h){ var sWidth,sHeight; sWidth=document.body.clientWidth; sHeight=document.body.scrollHeight; if(sHeight<window.screen.height){sHeight=window.screen.height;} var bgObj=document.createElement("div"); bgObj.setAttribute('id','bgDiv'); bgObj.style.position="absolute"; bgObj.style.top="0"; bgObj.style.background="#000000"; bgObj.style.filter="Alpha(Opacity=30);"; bgObj.style.left="0"; bgObj.style.width=sWidth + "px"; bgObj.style.height=sHeight + "px"; bgObj.style.zIndex = "10000"; document.body.appendChild(bgObj); massage_box.style.left = (document.body.clientWidth - w) / 2; //massage_box.style.top = (screen.height - h) / 2-80; massage_box.style.top = (getHeight() - h) / 2-80; massage_box.style.screenx = (document.body.clientWidth - w) / 2;//仅适用于Netscape massage_box.style.screeny = (screen.height - h) / 2-80;//仅适用于Netscape massage_box.style.width = w+"px"; massage_box.style.height = h+"px"; pop_title.innerHTML=tit; massage_box.style.display='' var popiframe='<iframe src="'+url+'" width="'+(w-11)+'px" height="'+(h-36)+'px" frameborder=0 scrolling=no></iframe>'; pop_iframe.innerHTML=popiframe; } function closeWithIframe(){ massage_box.style.display="none"; document.body.removeChild(document.getElementById("bgDiv")); } document.write('<div id="massage_box" style="position:absolute; FILTER: progid:DXImageTransform.Microsoft.DropShadow();z-index:10001;display:none">'); document.write('<div style="border-width:1 1 3 1; width:100%; height:100%; background:#fff; color:#666666; font-size:12px; line-height:150%">'); document.write('<div onmousedown=MDown(massage_box) style="background:#666666; height:20px; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px;color:#fff;cursor:move;padding:0 0 4px 0">'); document.write('<div style="display:inline; width:200px; position:absolute;padding:3px 0 0 5px" id=pop_title></div>'); document.write('<span onClick="closeWithIframe()" style="float:right; display:inline; cursor:pointer;padding:3px 5px 0 0;font-size:12px">关闭</span>'); document.write('</div>'); document.write('<div style="padding:5px" id=pop_iframe></div>'); document.write('</div>'); document.write('</div>'); </script> <body> <a onclick="openWithIframe('IP查询','http://www.51tiao.com/Plus/IP/?IP=222.66.7.130',300,200);">IP查询</a> <table style="height:1700px"> <tr> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> </table> <a onclick="openWithIframe('IP查询','http://www.51tiao.com/Plus/IP/?IP=222.66.7.130',300,200);">IP查询</a> </body> </html>
Tags:
ajax
固定链接
| 分类:常见问题 | 评论:0 | 引用:0 | 浏览:
点击这里获取该日志的TrackBack引用地址
相关文章:
发表评论:
名称(*)
邮箱
网站链接
正文(*)(留言最长字数:1000)
记住我,下次回复时不用重新输入个人信息
◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。
Powered By
Z-Blog
.Theme from
Google黑板报
By
Washun
Copyright © 2005 - 2008 风易博客
1982Y.Net.Cn
All Rights Reserved. 由
Wind88.Net
提供优质主机空间
沪ICP备05006417号
Search
订阅我的BLOG(RSS)
控制面板
[管理登录]
[给我留言]
网站分类
站务消息
(22)
域名主机
(3)
业界动态
(22)
常见问题
(27)
编程技术
(30)
网络安全
(5)
系统优化
(6)
个人空间
(43)
最新评论及回复
最近发表