一樣的代碼怎么不顯示一樣的效果?
<!DOCTYPE?html?PUBLIC?"-//W3C//DTD?XHTML?1.0?Transitional//EN"?"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html?xmlns="http://www.w3.org/1999/xhtml"> <head> <meta?http-equiv="Content-Type"?content="text/html;?charset=utf-8"?/> <meta?content="width=device-width,?initial-scale=1.0,?maximum-scale=1.0,?user-scalable=0;"?name="viewport"?/> <title>無標(biāo)題文檔</title> <link?href="jquery-3.2.2.js"?type="text/javascript"?/> <style> .loading{ width:100%;?height:100%;?position:fixed;?top:0;?left:0;?z-index:100;?background:#FFF; } .loading?.pic{width:64px;?height:64px;?background:url(image/5.gif);?position:absolute;?top:0;?bottom:0;?left:0;?right:0;?margin:auto; } </style> <script> $(function(){ var?loading='<div?class="loading"><div?class="pic"></div></div>' $("body").append(loading); setInterval(function(){ $(".loading").fadeOut(); },3000) }) </script> </head> <body> <img?src="http://imgsrc.baidu.com/imgad/pic/item/1e30e924b899a9017c518d1517950a7b0208f5a9.jpg"?alt=""?/> </body> </html>
這代碼有什么問題嗎,怎么不能出現(xiàn)視頻中的效果啊,直接顯示圖片
2017-10-16
我也是按照視頻來寫,也不行,發(fā)現(xiàn)是用了append之后代碼會加到/body結(jié)束之前,所以我后來改成prepend是將代碼插入到body里面的代碼前面,這樣就可以了.
2017-07-16
第9行代碼:應(yīng)該采用<script src=""></script>引入方式,因為引入的是JS。不是CSS。所以用LINK標(biāo)簽可能不對。
2017-07-12
<!DOCTYPE html>
<html>
<head>?
<meta charset="utf-8">?
<title>定時器進(jìn)度條</title>?
<style>
.loading{width: 100%; height: 100%; position: fixed; top: 0;left: 0;z-index: 100;
background: #fff;}
.loading.pic{width:64px ;height: 64px;border: 10px solid red;background: url(img/loading.gif);position: absolute;top: 0;bottom: 0;left: 0;right: 0;margin: auto;} /*為啥進(jìn)度條沒出來,連紅色框都沒出來,,我用HBuilder軟件 ? ? ? */ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
</style>
<script src="js/jquery-1.3.2.min.js"></script>
<script>
$(function(){
setInterval(function(){
$(".loading").fadeOut();
},3000)
})
</script>
</head>
<body>
<div class="loading">
<div class="pic"></div>
</div>
<img src="img/2.jpg" alt="" />
<img src="img/3.jpg" alt="" />
<img src="img/4.jpg" alt="" />
<img src="img/5.jpg" alt="" />
<img src="img/6.jpg" alt="" />
</body>
</html>
2017-07-04
?var?loading='<div?class="loading"><div?class="pic"></div></div>'沒加“;”