今日看到不错的弹窗js代码

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
$(‘.popup‘).click(function (event) {
event.preventDefault();
var iTop = (window.screen.height-30-600)/2;
var iLeft = (window.screen.width-10-850)/2;
window.open($(this).attr("href"), "popupWindow", "width=850,height=600,top="+iTop+",left="+iLeft+",scrollbars=yes");
});
</script>

示例:

<a hre=http://www.51cto.com class="popup">51cto</a>

 

收藏起来

今日看到不错的弹窗js代码,布布扣,bubuko.com

今日看到不错的弹窗js代码

上一篇:autocad.net中数据结构(blocktable,blocktablerecord,blockreference,layout,ModelSpace,PaperSpace)


下一篇:在.NET中使用JQuery 选择器精确提取网页内容