サマリー:<!DOCTYPE html> <html> <head> <title></title> <script type="text/javascript" src="http://apps.b
<!DOCTYPE html> <html> <head> <title></title> <script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/2.0.0/jquery.min.js"></script> <style> .div { width: 90%; height: 20px; background-color: blue; display: inline-block; } span { width:6%; height: 20px; line-height: 20px; display: inline-block; } </style> <script> function a(num){ var len = document.getElementsByClassName(num).length for(var i =0; i<len; i++){ document.getElementsByClassName(num)[i].style.backgroundColor = 'rgb('+Math.floor(Math.random()*256)+','+Math.floor(Math.random()*256)+','+Math.floor(Math.random()*256)+')' } } $(document).ready(function(){ a('div') $('.div').mouseenter(function(){ $(this).animate( { width:Math.random()*90+'%' },1000) }) $('.div').mouseleave(function(){ $(this).animate( { width:'90%' },1000) }) }) </script> </head> <body> <div> <span>html</span> <div class="div"></div> </div> <br> <div> <span>JavaScript</span> <div class="div"></div> </div> <br> <div> <span>jQuery</span> <div class="div"></div> </div> <br> <div> <span>php</span> <div class="div"></div> </div> </body> </html>
通過(guò)最近做案例總結(jié),html還是css邏輯還是非常重要,在寫(xiě)樣式的時(shí)候不是因?yàn)椴恢来a怎么寫(xiě),而是上下層關(guān)系比較亂
添削の先生:韋小寶添削時(shí)間:2019-01-07 09:09:59
先生のまとめ:對(duì)于樣式不清楚怎么寫(xiě)還是因?yàn)槟銓?xiě)少了 或者是你對(duì)課程中講的知識(shí)還沒(méi)理解透徹 課后記得要多復(fù)習(xí)和練習(xí)