我正在寻找侧身图像轮盘。有点像这样
http://image.prntscr.com/image/b178316bc4994229831f21109aa59555.png
我似乎无法在任何地方找到来源或示例。
答案 0 :(得分:-1)
基本HTML
`<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<img src="" alt="" id="picture1"/>
<img src="" alt="" id="picture2"/>
<img src="" alt="" id="picture3"/>
<img src="" alt="" id="picture4"/>
<button type="button" name="button" onclick="spin()">click</button>
</body>
</html>`
和javascript
function spin(){
var x = Math.floor( Math.random() * 3 )
switch (x) {
case 0:
document.getElementById('picture1');
break;
case 1:
document.getElementById('picture2')
break;
case 2:
document.getElementById('picture3')
break;
case 3:
document.getElementById('picture4')
break;
}
}
剩下的由你的朋友决定