jQuery弹出窗口打开链接的实现代码
下面给大家分享一段jquery代码实现弹出窗口打开链接的实现方法
window.open(url, name, style, replace); //弹出窗口打开链接,参数:网址,命名,窗体样式,是否替代原窗口
用处:打开新窗体,打开自定义页面
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>在弹出窗口中打开新连接</title> </head> <body> <div class="wrap"> <button class="open-new-link">打开链接</button> </div> </body> <script src="../source/jquery1.11.3.min.js"></script> <script> $(function() { $('.open-new-link').on('click', function() { var openNewLink = window.open('http://www.baidu.com', '手机百度', 'height=300, width=400, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=false, location=no, status=no'); //参数: url, 名称, 窗体样式 if(window.focus) { openNewLink.focus(); } return false; }) }) </script> </html>
相关推荐
EdwardSiCong 2020-11-23
85477104 2020-11-17
hhanbj 2020-11-17
81427005 2020-11-11
seoppt 2020-09-13
honeyth 2020-09-13
WRITEFORSHARE 2020-09-13
84483065 2020-09-11
momode 2020-09-11
85477104 2020-08-15
83510998 2020-08-08
82550495 2020-08-03
tthappyer 2020-08-03
84901334 2020-07-28
tthappyer 2020-07-25
TONIYH 2020-07-22
tztzyzyz 2020-07-20
83510998 2020-07-18
81463166 2020-07-17