improve swiping logic
This commit is contained in:
@@ -9,12 +9,12 @@ body {
|
|||||||
}
|
}
|
||||||
|
|
||||||
input[type=text], input[type=submit] {
|
input[type=text], input[type=submit] {
|
||||||
font-size: 20pt;
|
font-size: 18pt;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* paginator */
|
/* paginator */
|
||||||
div.paginator {
|
div.paginator {
|
||||||
font-size: 18pt;
|
font-size: 16pt;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
||||||
|
|||||||
@@ -11,17 +11,21 @@
|
|||||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function() {
|
$(function() {
|
||||||
$(document).on("swipeleft", function() {
|
$(document).on("swipeleft", function(e) {
|
||||||
var href = $(".paginator a[rel=next]").attr("href");
|
if (e.gesture.distance > 240) {
|
||||||
if (href) {
|
var href = $(".paginator a[rel=next]").attr("href");
|
||||||
window.location = href;
|
if (href) {
|
||||||
|
window.location = href;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on("swiperight", function() {
|
$(document).on("swiperight", function(e) {
|
||||||
var href = $(".paginator a[rel=prev]").attr("href");
|
if (e.gesture.distance > 240) {
|
||||||
if (href) {
|
var href = $(".paginator a[rel=prev]").attr("href");
|
||||||
window.location = href;
|
if (href) {
|
||||||
|
window.location = href;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -13,15 +13,19 @@
|
|||||||
<meta name="viewport" content="width=device-width,initial-scale=<%= @post.device_scale %>">
|
<meta name="viewport" content="width=device-width,initial-scale=<%= @post.device_scale %>">
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function() {
|
$(function() {
|
||||||
$(document).on("swipeleft", function() {
|
$(document).on("swipeleft", function(e) {
|
||||||
var href = $(".paginator a[rel=next]").attr("href");
|
if (e.gesture.distance > 240) {
|
||||||
if (href) {
|
var href = $(".paginator a[rel=next]").attr("href");
|
||||||
window.location = href;
|
if (href) {
|
||||||
|
window.location = href;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on("swiperight", function() {
|
$(document).on("swiperight", function(e) {
|
||||||
window.history.back();
|
if (e.gesture.distance > 240) {
|
||||||
|
window.history.back();
|
||||||
|
}
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user