慕粉3430898
2016-12-25 15:22:56
<!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>標(biāo)題:非鐵</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條經(jīng)驗 獲得超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>標(biāo)題:非鐵</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
提交
取消

html沒有關(guān)閉,你這個代碼應(yīng)該會報錯的啊