update hammer js

This commit is contained in:
r888888888
2014-08-14 15:05:11 -07:00
parent 8c52d2f376
commit 3fb0072dea
4 changed files with 47 additions and 22 deletions

View File

@@ -62,4 +62,28 @@ div#tags {
font-size: 24pt;
font-weight: bold;
}
.category-1 a, a.tag-type-1 {
color: #A00;
&:hover {
color: #B66;
}
}
.category-3 a, a.tag-type-3 {
color: #A0A;
&:hover {
color: #B6B;
}
}
.category-4 a, a.tag-type-4 {
color: #0A0;
&:hover {
color: #6B6;
}
}
}

View File

@@ -11,24 +11,25 @@
<meta name="viewport" content="width=device-width,initial-scale=1">
<script type="text/javascript">
$(function() {
$(document).on("swipeleft", function(e) {
if (e.gesture.distance > 150) {
var href = $(".paginator a[rel=next]").attr("href");
if (href) {
window.location = href;
}
}
});
$(document).on("swiperight", function(e) {
if (e.gesture.distance > 150) {
var href = $(".paginator a[rel=prev]").attr("href");
if (href) {
window.location = href;
$(document)
.hammer()
.on("swipeleft", function(e) {
if (e.gesture.distance > 125) {
var href = $(".paginator a[rel=next]").attr("href");
if (href) {
window.location = href;
}
}
}
})
});
})
.on("swiperight", function(e) {
if (e.gesture.distance > 125) {
var href = $(".paginator a[rel=prev]").attr("href");
if (href) {
window.location = href;
}
}
});
})
</script>
<% end %>