In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces "how to use javascript timeline ui control". In daily operation, I believe many people have doubts about how to use javascript timeline ui control. Xiaobian consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts about "how to use javascript timeline ui control". Next, please follow the editor to study!
Effect Preview:
Time training is calculated by using the difference between the two times and the length of the entire timeline.
LocateHandler = function () {var referTime = (that [that.length]-that [0]) / 86400000, I = 0, len = that.handler.length, temp = 0; for (; I
< len;) { temp = ((that[i] - that[0]) / (referTime * 86400000)) * that.parent.offsetWidth; that.fx(that.handler[i], 'left', ((i === len - 1 || i === 0) ? temp - 20 : temp), 50); i++; } 为了减少计算次数,用户操作时把图文面板,时间点,还有时间的位置信息都储存起来,这样在用户操作时计算并储存,第二次操作时读取缓存的位置信息。直接用css设置位置减少运算量 cache = [[],[],[]] 初始化时只有一组信息 触摸了2个时间点以后,位置数据已经被缓存起来了 if (!indicator.cache[1][index]) { if ((rect.left - div.offsetWidth / 2) < limit.left) { indicator.cache[1][index] = 'visibility:visible;left:0px;'; } else if ((rect.left + div.offsetWidth / 2) >Limit.right) {indicator.cache [1] [index] = 'visibility:visible;left:' + (limit.right-div.offsetWidth-limit.left) +' px;';} else {indicator.cache [1] [index] = 'visibility:visible;left:' + (rect.left-div.offsetWidth / 2-limit.left) +' px;';}
The position of the picture and text panel is also obtained by intelligent calculation. If it exceeds the left, it is aligned to the left. In other cases, it is centered with the time point reference, and so is the right excess.
The animation uses some of tween's algorithms that can be modified by yourself.
At this point, the study on "how to use the timeline ui control of javascript" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.