Comments (1)
I just pushed out an update to the CSS that gives the container a height. You'll want to pull that down. Now because the container actually has some dimensions to it you can attach your own touch event handler to determine if it is left or right (either in the "loaded" callback or immediately after calling the plugin).
var touchHandler = {
xDown: null,
yDown: null,
handleTouchStart: function(evt) {
this.xDown = evt.touches[0].clientX;
this.yDown = evt.touches[0].clientY;
},
handleTouchMove: function (evt) {
if (!this.xDown || !this.yDown) {
return;
}
var xUp = evt.touches[0].clientX;
var yUp = evt.touches[0].clientY;
var xDiff = this.xDown - xUp;
var yDiff = this.yDown - yUp;
// only comparing xDiff
// compare which is greater against yDiff to determine whether left/right or up/down e.g. if (Math.abs( xDiff ) > Math.abs( yDiff ))
if (Math.abs( xDiff ) > 0) {
if ( xDiff > 0 ) {
// swipe left
console.log("left")
} else {
//swipe right
console.log("right")
}
}
/* reset values */
this.xDown = null;
this.yDown = null;
canNavigate = true;
}
}
document.getElementById("flexiselDemo1").addEventListener('touchstart', touchHandler.handleTouchStart, false);
document.getElementById("flexiselDemo1").addEventListener('touchmove', touchHandler.handleTouchMove, false);
from flexisel.
Related Issues (20)
- - increment margin between items HOT 2
- Multiple calls on window resize HOT 4
- Element order when set infinitely:true HOT 4
- Slides. second item overlaps with previous and next one HOT 2
- Need to trigger methods.scroll(true); from page on mouseover event. HOT 1
- Dynamic Data Binding HOT 1
- visibleItem:1 is not working properly HOT 2
- Can this flexisel compatible with ie8 HOT 2
- Can we turn off slider on small widths HOT 3
- Event Propagation HOT 1
- How to disable touch swipe HOT 1
- When autoplay is enabled, DOM gets bombarded with duplicate clones. HOT 3
- How install in angualr js..? HOT 2
- Disable next button condition HOT 1
- Add bullets pagination HOT 1
- Needs a up/down carousal animation HOT 1
- Pause Slider until it's visible in the viewport
- For many picture norounded value problem solved liked below
- Not working with latest jquery version 3.x HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flexisel.