Skip to content

Instantly share code, notes, and snippets.

@jlazanowski
jlazanowski / gist:6302508
Created August 22, 2013 02:21
Carousel Swipe support with multiple sliders
<script>
$(document).ready(function() {
//add your other targets here
$("#myCarousel, #myOtherCarousel").swiperight(function() {
$(this).carousel('prev');
});
//add your other targets here
$("#myCarousel, #myOtherCarousel").swipeleft(function() {
$(this).carousel('next');
});
@jlazanowski
jlazanowski / gist:6302505
Last active December 21, 2015 11:59
Carousel Swipe support with Hammer.js
<script>
$(document).ready(function() {
$('#myCarousel').hammer().on('swipeleft', function(){
$(this).carousel('next');
})
$('#myCarousel').hammer().on('swiperight', function(){
$(this).carousel('prev');
})
});
</script>
@jlazanowski
jlazanowski / gist:6302501
Last active January 5, 2017 06:15
Carousel Swipe support with TouchSwipe
<script>
$(document).ready(function() {
//Enable swiping...
$(".carousel-inner").swipe( {
//Generic swipe handler for all directions
swipeLeft:function(event, direction, distance, duration, fingerCount) {
$(this).parent().carousel('prev');
},
swipeRight: function() {
@jlazanowski
jlazanowski / gist:6302491
Created August 22, 2013 02:18
Carousel Swipe support with jQuery Mobile
<script>
$(document).ready(function() {
$("#myCarousel").swiperight(function() {
$(this).carousel('prev');
});
$("#myCarousel").swipeleft(function() {
$(this).carousel('next');
});
});
</script>
@jlazanowski
jlazanowski / gist:6302448
Created August 22, 2013 02:10
Custom jQuery Mobile 1.4.2
/*! jQuery Mobile v1.3.2 | Copyright 2010, 2013 jQuery Foundation, Inc. | jquery.org/license */
(function(e,t,n){typeof define=="function"&&define.amd?define(["jquery"],function(r){return n(r,e,t),r.mobile}):n(e.jQuery,e,t)})(this,document,function(e,t,n,r){(function(e,t,n,r){function x(e){while(e&&typeof e.originalEvent!="undefined")e=e.originalEvent;return e}function T(t,n){var i=t.type,s,o,a,l,c,h,p,d,v;t=e.Event(t),t.type=n,s=t.originalEvent,o=e.event.props,i.search(/^(mouse|click)/)>-1&&(o=f);if(s)for(p=o.length,l;p;)l=o[--p],t[l]=s[l];i.search(/mouse(down|up)|click/)>-1&&!t.which&&(t.which=1);if(i.search(/^touch/)!==-1){a=x(s),i=a.touches,c=a.changedTouches,h=i&&i.length?i[0]:c&&c.length?c[0]:r;if(h)for(d=0,v=u.length;d<v;d++)l=u[d],t[l]=h[l]}return t}function N(t){var n={},r,s;while(t){r=e.data(t,i);for(s in r)r[s]&&(n[s]=n.hasVirtualBinding=!0);t=t.parentNode}return n}function C(t,n){var r;while(t){r=e.data(t,i);if(r&&(!n||r[n]))return t;t=t.parentNode}return null}function k(){g=!1}function L(){g=!0}f