qiqiboy / touchslider Goto Github PK
View Code? Open in Web Editor NEWTouchSlider是一个轻量级的javascript组件,设计的目的是提供一个可以方便实现全平台(PC及移动端触摸界面)的幻灯slider效果。
Home Page: http://github.boy.im/touchslider/index.html
License: MIT License
TouchSlider是一个轻量级的javascript组件,设计的目的是提供一个可以方便实现全平台(PC及移动端触摸界面)的幻灯slider效果。
Home Page: http://github.boy.im/touchslider/index.html
License: MIT License
比如touchslider居中对齐,但我动态改变li的宽高,发现些时是无法居中的,只有改变resize时,才会重新居中。
当只有一个li的时候,滑动会出现空白
项目需求:左右切换,每屏有两个单位(li标签),li总数量不确定并经常添加
我原来以为很简单,用css就可以搞定;
于是我为li添加 width:50% !important;
问题出现了,li的父级ul并不是手机屏幕的全屏宽;
最后想了半天,这个问题css是无法解决的,必须修改js库才能搞定;
我试过在最后一张直接设置css(),但都会被添加动画,以动画的方式跳转,为什么?
多测次数,发现width不断叠加了,10000px有时叠到5W多,left的算法也不准.
我根据自己的将其改成了
this.total=this.lengththis.size;
css[this.direction?'top':'left']=-this.currentthis.size+'px';
始终保持宽度和一直居中了
希望能js里获取slider播放到的页号
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.