评论

收藏

网站弹出层代码

avatar admin | 1168 人阅读 | 0 人评论 | 2017-11-29

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.   <meta charset="utf-8">
  5.   <title>开始使用layer</title>
  6. </head>
  7. <body>
  8. <script src="http://www.eazhijia.com/template/cmsoft_economy_141230/cmsoft/js/jquery.js" type="text/javascript"></script>
  9. <script src="http://res.layui.com/layui/release/layer/dist/layer.js"></script>
  10. <span id="hello3">
  11. <script>
  12.   $('#parentIframe').on('click', function(){
  13.     layer.open({
  14.       type: 2,
  15.       title: '财经日历',
  16.       maXMin: true,
  17.       shadeClose: true, //点击遮罩关闭层
  18.       area : ['800px' , '520px'],
  19.       content: 'http://viewapi.kxt.com/rili/'
  20.     });
  21.   });
  22.   </script>
  23.   </span>
  24.   <li><a id="parentIframe" href="javascript:;">财经日历</a></li>
  25. <script>!function(){for(var i =1;i <=5;i++){new Function($('#hello'+ i).text())();}
  26. }();</script>
  27.   </body>
  28. </html>
复制代码


注意:jQuery要在layui.js前面加载
""
还没有人打赏,支持一下
您需要登录后才可以回帖 登录 | 注册 微信登录

EA之家评论守则