[geeklog-cvs] geeklog: Denim: added a feature to open and close block by touch...
geeklog-cvs at lists.geeklog.net
geeklog-cvs at lists.geeklog.net
Wed Apr 25 06:53:35 EDT 2012
changeset 8621:c7fad099de13
url: http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/c7fad099de13
user: dengen
date: Wed Apr 25 19:51:33 2012 +0900
description:
Denim: added a feature to open and close block by touching title of block
diffstat:
public_html/layout/denim/javascript/script.js | 31 ++++++++++++++++----------
1 files changed, 19 insertions(+), 12 deletions(-)
diffs (39 lines):
diff -r dd7f1eaff403 -r c7fad099de13 public_html/layout/denim/javascript/script.js
--- a/public_html/layout/denim/javascript/script.js Wed Apr 25 19:43:13 2012 +0900
+++ b/public_html/layout/denim/javascript/script.js Wed Apr 25 19:51:33 2012 +0900
@@ -35,16 +35,23 @@
$('#navigation_ul').tinyNav({
active: 'selected'
});
+ var istouch = ('ontouchstart' in window);
+ if (istouch) {
+ var obj = $('.block-title');
+ $(".block-left-content").css("display", "none");
+ $(".block-right-content").css("display", "none");
+ obj.live('touchstart', function() {
+ this.touched = true;
+ });
+ obj.live('touchmove', function() {
+ this.touchmoved = true;
+ });
+ obj.live('touchend', function() {
+ if (this.touched && !this.touchmoved) {
+ $(this).next().toggle();
+ }
+ this.touched = false;
+ this.touchmoved = false;
+ });
+ }
});
-
-/*
-$(function() {
-// $(".block-left-content").css("display", "none");
-// $(".block-right-content").css("display", "none");
-
- $('.block-title').live('click touchend', function() {
- $(this).next().toggle();
- });
-
-});
-*/
More information about the geeklog-cvs
mailing list