Git Product home page Git Product logo

jquery.swipebutton.js's Introduction

swipeButton.js

SwipeButton is a jQuery Mobile plugin which allows developers to add iPhone style buttons to listview rows by attaching to the swipe event. This project contains everything you need to get started.

jQuery Mobile 1.1 compatible

jQuery Mobile made a slight change in version 1.1 with the way they create buttons inside list views. swipeButton has been updated to account for that change and offers a test case for your perusal.

Example

View a simple demo of swipeButton

Quick start

Clone the git repo - git clone [email protected]:commadelimited/jquery.swipeButton.js.git - or download it

Usage & Documentation

Minimum usage requires that you override the default click event. All other arguments are optional.

$('#swipeMe li').swipeDelete({
	click: function(e){
		e.preventDefault();
		$(this).parents('li').remove();
	}
});

$('#swipeMe li').swipeDelete({
	direction: 'swiperight', // standard jquery mobile event name
	btnLabel: 'Delete',
	btnTheme: 'b',
	btnClass: 'aSwipeBtn',
	click: function(e){
		e.preventDefault();
		var url = $(e.target).attr('href');
		$(this).parents('li').remove();
		$.post(url, function(data) {
			console.log(data);
		});
	}
});

Unit Tests

You can now run unit tests on swipeButton by loading tests/jquery.swipeButton.js.html in the browser of your choice.

Contributing

You are invited to contribute code and suggestions to this project. The more contributors the merrier.

Project Info

3rd party libraries required:

  • jQuery: MIT/GPL license
  • jQuery Mobile: MIT/GPL license

Custom bits:

Public domain

jquery.swipebutton.js's People

Contributors

commadelimited avatar scottbuckel avatar mongoosesec avatar

Watchers

James Cloos avatar peterwang avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.