-
焦點圖輪播查看全部
-
getAttri bute查看全部
-
index是自定義屬性。不能通過this.index獲取,而是通過this.getAtrribute('index')獲取查看全部
-
debugger 運行到此語句停止。好檢查變量數值查看全部
-
動畫函數 ①圖片在一定時間內進行位移,要判斷是否達到目標值,沒有達到還要繼續做位移 ②聲明一個變量用offset總共的偏移量除以次數(位移總時間除以位移間隔時間)求出每次移動多少 ③判斷speed小于0并且left值是否大于目標值newLeft或speed大于0并且left值小于目標值,這兩種情況讓它做位移 ④再判斷中放入定時器,一個函數不停的在一定的條件之后調用自身這種做法叫做遞歸 ⑤優化:聲明一個函數,做動畫是否在運行的存放,開始狀態為false表示沒有運行 ⑥!取反查看全部
-
按鈕啊查看全部
-
http://www.cnblogs.com/LIUYANZUO/p/5679753.html 主要可以作為參考查看全部
-
//定時器 var timer; function play() { timer=setInterval(function(){next.onclick();},3000) } function stop() { clearInterval(timer); }查看全部
-
for(var i=0;i<buttons.length;i++) { buttons[i].onclick=function(){ if(this.className=="on"){return;} var myIndex=parseInt(this.getAttribute('index')); var offset=-600*(myIndex-index); animate(offset); index=myIndex; showButtons(); } }查看全部
-
for(var i=0;i<buttons.length;i++) { buttons[i].onclick=function(){ var myIndex=parseInt(this.getAttribute('index')); var offset=-600* } }查看全部
-
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);} */ }查看全部
-
父容器:承載圖片,圓點下標,左右箭頭切換,溢出隱藏:overflow:hidden 父容器相對定位:position:relative,z-index:1; 圓點和左右箭頭的z-index:2; position:absolute; 左右箭頭一開始設置隱藏 display:none; 鼠標移入時顯示; 給圖片容器設置行內style:left值,讓它顯示第一張圖;查看全部
-
動畫實現的代碼風格查看全部
-
求位移的速度查看全部
-
輪番查看全部
舉報
0/150
提交
取消