<!DOCTYPE html><html><head> <meta http-equiv="content-type" content="text/html" charset="UTF-8"> <title>lightBox</title> <script type="text/javascript" src= "jQuery.js" > </script> <script type="text/javascript" src= "demo.js" > </script> <link rel="stylesheet" href="bas.css" type="text/css"> <link rel="stylesheet" href="box.css" type="text/css"></head><body><!--遮罩层--><div id="lightbox-max"></div><!--弹出层--><div id="lightbox-poput"> <div> <span class="lightbox-btn lightbox-btn-show"></span> <img src="2-2.jpg" width="100%"> <span class="light-next-btn lightbox-next-btn-show"></span> </div> <div> <div> <p>标题:非铁</p> <span>索引:0027</span> </div> <div></div> </div></div><script> $(function(){ var Light=new lightBox(); });</script></body></html;(function($){ alert(1); var lightBox=function(){ alert(2); }; lightBox.prototype={ }; window["lightBox"]=lightBox;})(jQuery);为什么alert 没有弹出1啊??????????
4 回答
隔壁老伍丶
TA贡献15条经验 获得超6个赞
<!DOCTYPE html> <html> <head> <meta http-equiv="content-type" content="text/html" charset="UTF-8"> <title>lightBox</title> <script type="text/javascript" src= "jQuery.js" > </script> <script type="text/javascript" src= "demo.js" > </script> <link rel="stylesheet" href="bas.css" type="text/css"> <link rel="stylesheet" href="box.css" type="text/css"> </head> <body> <!--遮罩层--> <div id="lightbox-max"></div> <!--弹出层--> <div id="lightbox-poput"> <div> <span class="lightbox-btn lightbox-btn-show"></span> <img src="2-2.jpg" width="100%"> <span class="light-next-btn lightbox-next-btn-show"></span> </div> <div> <div> <p>标题:非铁</p> <span>索引:0027</span> </div> <div></div> </div> </div> <script> $(function(){ var Light=new lightBox(); }); ;(function($){ alert(1); var lightBox=function(){ alert(2); }; lightBox.prototype={ }; window["lightBox"]=lightBox; })(jQuery); </script> </body> </html>
添加回答
举报
0/150
提交
取消