abstrakt:<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0">&
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>隨機(jī)抽取顏色</title> <script type="text/javascript" src="jquery-3.3.1.min.js"> </script> <script type="text/javascript"> function aa(tag){ var len=document.getElementsByTagName(tag).length for(var i=0;i<len;i++){ document.getElementsByTagName(tag)[i].style.backgroundColor='rgb('+Math.floor(Math.random()*256)+','+Math.floor(Math.random()*256)+','+Math.floor(Math.random()*256)+')' } } function cc(tag){ var len=document.getElementsByTagName(tag).length for(var i=0;i<len;i++){ document.getElementsByTagName(tag)[i].text=Math.floor(Math.random()*256) } } $(document).ready(function(){ aa('a') $('button').click(function(){ aa('a') cc('a') $('a').mouseover(function(){ $bb=$(this).css('backgroundColor') $(this).css('box-shadow','0px 0px 40px '+$bb) $(this).css('border-radius','20px') }) $('a').mouseleave(function(){ $bb=$(this).css('backgroundColor') $(this).css('box-shadow','none') $(this).css('border-radius','100px') }) }) }) </script> <style> a{ display:block; background-color: aliceblue; width: 200px; height: 200px; border-radius: 100px; line-height: 200px; text-align: center; float:left; text-decoration: none; margin:50px 20px; } </style> </head> <body> <button>點(diǎn)擊換色</button> <a href="#">1</a> <a href="#">2</a> <a href="#">3</a> <a href="#">4</a> </body> </html>
Korrigierender Lehrer:查無此人Korrekturzeit:2019-02-11 09:42:30
Zusammenfassung des Lehrers:作業(yè)完成的不錯(cuò),下次把代碼整理下。先看下math.random這個(gè)函數(shù)做什么的,就 知道為啥*256了。也可以私聊講課老師,作業(yè)區(qū)無法互動(dòng)的。