avinoamr / bootstrap-carousel-swipe Goto Github PK
View Code? Open in Web Editor NEWAdding swipe behavior to Bootstrap's Carousel
License: MIT License
Adding swipe behavior to Bootstrap's Carousel
License: MIT License
Hi, i'm finding a way to make this script useful also for desktop mode so i try addending this code:
...
this.$element
.on('touchstart', $.proxy(this.touchstart,this))
.on('touchmove', $.proxy(this.touchmove,this))
.on('touchend', $.proxy(this.touchend,this))
/* onmousedown, onmousemove, onmouseup */
.on('onmousedown', $.proxy(this.onmousedown,this))
.on('onmousemove', $.proxy(this.onmousemove,this))
.on('onmouseup', $.proxy(this.onmouseup,this))
/* END */
.on('slide.bs.carousel', $.proxy(this.sliding, this))
.on('slid.bs.carousel', $.proxy(this.stopSliding, this))
...
...
/* onmousedown, onmousemove, onmouseup */
CarouselSwipe.prototype.onmousedown = function(e) {
if (this.sliding || !this.options.swipe) return;
var touch = e // e.originalEvent.touches ? e.originalEvent.touches[0] : e
...
CarouselSwipe.prototype.onmousemove = function(e) {
if (this.sliding || !this.options.swipe) return;
var touch = e // e.originalEvent.touches ? e.originalEvent.touches[0] : e
...
CarouselSwipe.prototype.onmouseup = function(e) {
...
has samone a solution for this? i think the problem is the corrispective of e.orgianlEvent.touches for mouse event.
Hello :)
Nice work ๐ But I am searching if any callback implementation for active item. Like, After swipe, a item of carousel will load/display on screen. Of which able to get a item id/class based on which may show other things using jQuery.
Regards :)
Hey,
is there a Live example anywhere? (???!!!)
Is this compatible with bs 2.3?
I've tried carousel-swipe.js for bootstrap 3.1.1 and it works perfectly. As soon I update to Bootstrap 3.2.0 it stops working.
This is working really well - however, I'm having the following problem:
When I start swiping in either direction, the slide moves under my finger as expected (so far, so good).
When I release and the slide switch takes over, the slide automatically jumps back to the beginning (so you get a jump in position).
Ideally it would carry on from where I release. Is that possible?
when I go to https://rails-assets.org/components/new and try to add this package it says
bootstrap-carousel-swipe has no versions defined. Please create an issue in component's repository.
So, I'm opening an issue.
I saw that the version is on the bower file, but after some googling, I found that it actually looks for a tag (0.1.0
in this case) in the repo.
Getting error:
"Cannot read property 'slice' of undefined" on touchend:
"...teTransitionEnd(1e3*this.$active.css("transition-duration").slice(0,-1)),a.css("transform",""),this.cycling&&this.carousel.cycle(),this.$act..."
Any idea?
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.