I need a slider which only works on mobile. I searched for some plugins and found swipe.js. I just check if the width of the sceen is lower than 768px and initiate the plugin. If its greater than 768px, I try to disable it using the kill function but it's not working and still updating the inline style instead of showing the normal bootstrap layout.
$(window).resize(function(){
if( $(this).width() < 768 ) {
window.mySwipe = Swipe(document.getElementById('slider'));
} else {
window.mySwipe.kill();
}
});
And thats what my html is looking like:
<div class="col-md-6 col-md-pull-6 swipe" id='slider'>
<div class="row swipe-wrap">
<div class="col-sm-6"></div>
<div class="col-sm-6"></div>
</div>
</div>
Any ideas what the problem could be? Or could you recommend a other plugin for that purpose?
best, Patrick