This repository has been archived by the owner on May 10, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
/
swipe-1.1.html
56 lines (50 loc) · 1.75 KB
/
swipe-1.1.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Swipe to Delete</title>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" />
<link rel="stylesheet" href="src/jquery.swipeButton.css" />
<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
<script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>
<script src="src/jquery.swipeButton.js"></script>
<script>
$(document).ready(function() {
// attach the plugin to an element
$('#swipeMe li').swipeDelete({
btnTheme: 'e',
click: function(e){
e.preventDefault();
var url = $(e.target).attr('href');
$(this).parents('li').slideUp();
$.post(url, function(data) {
console.log(data);
});
}
});
});
</script>
</head>
<body>
<div data-role="page">
<div data-role="header">
<h1>swipeButton</h1>
</div>
<div data-role="content">
<ul id="swipeMe" data-role="listview">
<li data-swipeurl="swiped.html?1"><a href="row-click.html">List Item One</a></li>
<li data-swipeurl="swiped.html?2"><a href="row-click.html">List Item Two</a></li>
<li data-swipeurl="swiped.html?3"><a href="row-click.html">List Item Three</a></li>
</ul><br />
<!--
uncomment this button to easily trigger the swipe event from a desktop browser
<br /><br />
<a href="javascript: $('#swipeMe li:nth-child(3)').trigger('swiperight')" data-role="button">trigger swipe right</a>
-->
<p align="center">Swipe to the right on any list item to display the button</p>
<a href="https://github.com/commadelimited/jquery.swipeButton.js" data-role="button">Get the code</a>
</div>
</div>
</body>
</html>