av激情亚洲男人的天堂国语,日韩欧美精品一中文字幕,无码av一区二区三区无码,国产又色又爽又刺激的a片,国产又色又爽又刺激的a片

很棒的時間線ui控件(純javascript)

效果預(yù)覽:

創(chuàng)新互聯(lián)建站2013年開創(chuàng)至今,是專業(yè)互聯(lián)網(wǎng)技術(shù)服務(wù)公司,擁有項目成都網(wǎng)站建設(shè)、網(wǎng)站設(shè)計網(wǎng)站策劃,項目實施與項目整合能力。我們以讓每一個夢想脫穎而出為使命,1280元隆回做網(wǎng)站,已為上家服務(wù),為隆回各地企業(yè)和個人服務(wù),聯(lián)系電話:18982081108

在線預(yù)覽:傳送門

時間練利用兩個時間之間的差別與整個時間軸的長度運(yùn)算得來

 
 
 
 
  1. locateHandler = function () { 
  2.         var referTime = (that[that.length] - that[0]) / 86400000, i = 0, len = that.handler.length, temp = 0; 
  3.         for (; i < len;) { 
  4.             temp = ((that[i] - that[0]) / (referTime * 86400000)) * that.parent.offsetWidth; 
  5.             that.fx(that.handler[i], 'left', ((i === len - 1 || i === 0) ? temp - 20 : temp), 50); 
  6.             i++; 
  7.         }

為了減少計算次數(shù),用戶操作時把圖文面板,時間點(diǎn),還有時間的位置信息都儲存起來,這樣在用戶操作時計算并儲存,第二次操作時讀取緩存的位置信息。直接用css設(shè)置位置減少運(yùn)算量

cache = [[],[],[]]

初始化時只有一組信息

觸摸了2個時間點(diǎn)以后,位置數(shù)據(jù)已經(jīng)被緩存起來了

 
 
 
 
  1. if (!indicator.cache[1][index]) { 
  2.     if ((rect.left - div.offsetWidth / 2) < limit.left) { 
  3.         indicator.cache[1][index] = 'visibility:visible;left:0px;'; 
  4.     } else if ((rect.left + div.offsetWidth / 2) > limit.right) { 
  5.                 indicator.cache[1][index] = 'visibility:visible;left:' + (limit.right - div.offsetWidth - limit.left) + 'px;'; 
  6.     } else { 
  7.         indicator.cache[1][index] = 'visibility:visible;left:' + (rect.left - div.offsetWidth / 2 - limit.left) + 'px;'; 
  8.     } 
  9.               
  10. }

圖文面板的位置也是經(jīng)過智能計算獲取,如果超出左邊則左對齊,其他情況則以時間點(diǎn)位參考居中,右邊超出亦然

動畫使用了tween的一些算法 可以自己修改。


標(biāo)題名稱:很棒的時間線ui控件(純javascript)
網(wǎng)頁網(wǎng)址:http://uogjgqi.cn/article/dheieoe.html
掃二維碼與項目經(jīng)理溝通

我們在微信上24小時期待你的聲音

解答本文疑問/技術(shù)咨詢/運(yùn)營咨詢/技術(shù)建議/互聯(lián)網(wǎng)交流