-
debugger 添加斷點查看全部
-
window.onload=function() { var container=document.getElementById('container'); //獲取父容器 var list=document.getElementById('list'); //獲取list列表元素 var buttons=document.getElementById('button').getElementsByTagName('span'); //獲取按鈕,結果是數組,buttons.length=5; var prev=document.getElementById('prve'); //獲取按鈕 var next=document.getElementById('next'); next.onclick=function(){ list.style.left=parseInt(list.style.left)-600+'px'; } next.onclick=function(){ list.style.left=parseInt(list.style.left)+600+'px'; } /* 封裝為函數: function animate(offect) { list.style.left=parseInt(list.style.left)+offset+‘px’; } 調用函數: prev.onclick=function(){ animate(600);} next.onclick=function(){ animate(-600);} */ }查看全部
-
Button重置,增加和刪除active的CSS樣式查看全部
-
樣式表查看全部
-
原理:控制container內圖片列表的left值,來控制顯示的圖片查看全部
-
技能點查看全部
-
#container:hover .arrow{display:block},當把鼠標移動到容器上,箭頭顯示查看全部
-
所用技能點查看全部
-
輪播圖查看全部
-
定時器設置與清除查看全部
-
parseInt()將數組轉換為數字查看全部
-
debugger 斷點查看全部
-
debugger查看全部
-
overflow 隱藏查看全部
-
如果把style=left寫到css里就無法滾動,是因為document.getElementById(‘element').style.xxx可以獲取元素的樣式信息,可是它獲取的只是DOM元素style屬性里的樣式規則,對于通過class屬性引用的外部樣式表,就拿不到我們要的信息了。 DOM標準里有個全局方法getComputedStyle,可以獲取到當前對象樣式規則信息,在IE下可以用currentStyle,查看全部
舉報
0/150
提交
取消