我按視頻焦點輪播里的視頻寫的第一個怎么一點反應都沒有
<!DOCTYPE html>
<html>
<head>
??? <meta charset="UTF-8">
??? <title>焦點輪播圖</title>
??? <style type="text/css">
??????? *{ margin: 0; padding: 0; text-decoration: none;}
??????? body { padding: 20px;}
??????? #container { width: 600px; height: 400px; border: 3px solid #333; overflow: hidden; position: relative;}
??????? #list { width: 4200px; height: 400px; position: absolute; z-index: 1;}
??????? #list img { float: left;}
??????? #buttons { position: absolute; height: 10px; width: 100px; z-index: 2; bottom: 20px; left: 250px;}
??????? #buttons span { cursor: pointer; float: left; border: 1px solid #fff; width: 10px; height: 10px; border-radius: 50%; background: #333; margin-right: 5px;}
??????? #buttons .on {? background: orangered;}
??????? .arrow { cursor: pointer; display: none; line-height: 39px; text-align: center; font-size: 36px; font-weight: bold; width: 40px; height: 40px;? position: absolute; z-index: 2; top: 180px; background-color: RGBA(0,0,0,.3); color: #fff;}
??????? .arrow:hover { background-color: RGBA(0,0,0,.7);}
??????? #container:hover .arrow { display: block;}
??????? #prev { left: 20px;}
??????? #next { right: 20px;}
??? </style>
<script type="text/javascript">
window.onload = function (){
?? ?var container = document.getElementById('container');
?? ?var list = document.getElementById('list');
?? ?var buttons = document.getElementById('buttons').getElementsByTagName('span');
?? ?var prev = document.getElementById('prev')
?? ?var next = document.getElementById('next')
?? ?
?? ?next.oncanplay = function(){
?? ??? ?list.style.left = paresInt(list.style.left) - 600 + 'px';
?? ??? ?}
?? ?}
</script>
</head>
<body>
<div id="container">
??? <div id="list" style="left: -600px;">
??????? <img src="img/5.jpg" alt="1"/>
??????? <img src="img/1.jpg" alt="1"/>
??????? <img src="img/2.jpg" alt="2"/>
??????? <img src="img/3.jpg" alt="3"/>
??????? <img src="img/4.jpg" alt="4"/>
??????? <img src="img/5.jpg" alt="5"/>
??????? <img src="img/1.jpg" alt="5"/>
??? </div>
??? <div id="buttons">
??????? <span index="1" class="on"></span>
??????? <span index="2"></span>
??????? <span index="3"></span>
??????? <span index="4"></span>
??????? <span index="5"></span>
??? </div>
??? <a href="javascript:;" id="prev" class="arrow"><</a>
??? <a href="javascript:;" id="next" class="arrow">></a>
</div>
</body>
</html>
~~~~~~~~~~~~~~~~~~哪位大神可以教下
2022-03-24
起碼現(xiàn)階段光學swift還不行。感覺對于初學者來說現(xiàn)在更尷尬。只學swift短期內(nèi)不能工作。不學以后會慢慢的凸顯他的重要。當然用圖形化的工具比較只管也比較簡單,這是可以的,用命令話寫命令可以鍛煉大家SQL命令這的知識,也可以,都能實現(xiàn)!第二版本中我們就使用圖形化工具^_^
2016-08-19
(1)你把parseInt(),拼寫錯誤啦;
(2)next綁定 onclick?事情啦;
2016-08-19
? ? next.oncanplay = function(){
?? ??? ?list.style.left = paresInt(list.style.left) - 600 + 'px';
?? ??? ?}
?? ?}
首先你上面的paresInt寫錯了,是parseInt。
然后你是說要點擊是應該要用onclick事件。
希望對你有幫助。