From dfe796d8fa50ef9356337e0546680f0877a413a3 Mon Sep 17 00:00:00 2001 From: ruanyf Date: Tue, 29 Apr 2014 20:05:23 +0800 Subject: [PATCH] add page flip --- js/ditto.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/ditto.js b/js/ditto.js index 5009e87..f8b0927 100644 --- a/js/ditto.js +++ b/js/ditto.js @@ -17,7 +17,7 @@ var ditto = { }; var disqusCode = '

留言

'; -var header = $('#flip'), +var header, headerHeight = 30, treshold = 0, lastScroll = 0; @@ -45,7 +45,7 @@ function initialize() { treshold = (treshold+diff>headerHeight) ? headerHeight : treshold+diff; treshold = (treshold < 0) ? 0 : treshold; - header.css('bottom', (-treshold)+'px'); + $('#flip').css('bottom', (-treshold)+'px'); lastScroll = newScroll; });