<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>
收藏起来