Stereobit / dragend

dragend JS – a touch ready, full responsive, content swipe script
http://stereobit.github.com/dragend/
MIT License
486 stars 113 forks source link

dragend.js, Readme File:

2012-09-09, [Tobias Otte]

DESCRIPTION

dragend.js is a touch ready, fully responsive, content swipe script. It has no dependencies but it can, doesn't have to, be used as a jQuery plugin.

The current version is 0.2.0 release candidate 3

Demos

Features

Browser support

How to

<div id="demo">
  <div class="dragend-page"></div>
  <div class="dragend-page"></div>
</div>

with jQuery

$("#demo").dragend(options);

without jQuery

new Dragend(document.getElementById("demo"), options);

update and jump to page

You can call the dragend method a second time to trigger some actions. When you want to go to a page when you click on a link you could do something like this:

$("#container").dragend();

$("#my-link").on("click", function() {
   $("#container").dragend({
    scrollToPage: 2
  });
});

instead of scrollToPage you can use jumpToPage to get to a page without a animation. Or

$("#container").dragend("left");

to swipe left or right.

destroy

Call the destroy method to unbind the events and reset the styles

var instance =  new Dragend();
instance.destroy();

Options

CHANGELOG

LICENCE

Copyright (c) 2012 Tobias Otte

Licensed under MIT License:

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.