In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
Editor to share with you how to use JS to achieve slideshow slides, I believe that most people do not understand, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
Example
Documentbody {margin: 0;} # wrap {margin: 100px auto;position: relative;width: 400pxTH height: 300px border: 5px solid # 000X height: hidden;} # list {position: absolute;left: 0 position top: 0 position width: 400% position style: none;padding: 0 position margin: 0;} # list li {width: 25% position float: left;} img {vertical-align: top;} # navs {position: absolute;left: 0X bottom: 30pxscape height: 12pxscape width: 100% landscape match: center } # navs a {display: inline-block;width: 12pxposition height: 12pxposition verticalmatch: top;background: # fff;margin: 05pxbordermuri radius: 6px;} # navs .active {background: # f60;}
(function () {var wrap = document.querySelector ('# wrap'); var list = document.querySelector ('# list'); var navs = document.querySelectorAll ('# navs a'); var wrapW = css (wrap, "width"); list.onmousedown = function (e) {clearInterval (list.timer); / / clear animation var startMouseX = e.clientXten var elX = css (list, "left"); _ document.onmousemove = function (e) {var nowMouseX = e.clientXmittcss (list, "left", nowMouseX-startMouseX + elX);} _ document.onmouseup = function (e) {_ document.onmousemove = null;_document.onmouseup = null;var left = css (list, "left"); var now =-Math.round (left/wrapW); / / get several pictures console.log (now); now = nownavs.length-1?navs.length-1:now;left = now * wrapW / / calculate the distance left needs to walk to this picture: startMove ({el: list,target: {left:-left}, type: "easeOutStrong", time: 800}); for (var I = 0; I < navs.length; iTunes +) {navs [I] .className = "";} navs [now] .className = "active";}; return false;// blocks default events (where the role prevents the picture from being selected)};}) () The above is all the contents of the article "how to use JS to achieve slippery screen slides". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
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.