亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

這個作業(yè)完成的很好,我自己都佩服我自己,就是math.random()不懂這個函數,為啥*256?

??? 2019-02-08 19:38:04 292
????:<!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>隨機抽取顏色</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>點擊換色</button>
<a href="#">1</a>
<a href="#">2</a>
<a href="#">3</a>
<a href="#">4</a>
</body>
</html>


?? ???:查無此人?? ??:2019-02-11 09:42:30
???? ??:作業(yè)完成的不錯,下次把代碼整理下。先看下math.random這個函數做什么的,就 知道為啥*256了。也可以私聊講課老師,作業(yè)區(qū)無法互動的。

??? ??

?? ??