diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..f09d8e2 Binary files /dev/null and b/.DS_Store differ diff --git a/css/main.css b/css/main.css index 6f55232..9ea4525 100644 --- a/css/main.css +++ b/css/main.css @@ -249,6 +249,13 @@ textarea { margin-right: 20px; } +#content-scroller { + overflow: scroll; + -webkit-overflow-scrolling: touch; + width:100%; + height:200px; +} + article h2 { background-color: #D8D8CA; width: 100%; diff --git a/index.html b/index.html index 19212db..606c1e5 100644 --- a/index.html +++ b/index.html @@ -70,13 +70,17 @@

SOMETHING

-
- Squirrel -

SQUIRREL SAYS HELLO

-

This is an example of a menu that slides down from the top with a swiping motion. The idea was taken from CNN's iPhone app. I tried to model the interaction as close as I could using Javascript and CSS3.

-

Note: This is one of thoose demos that really only shines in a hybrid container. I have included a config.xml file that you can modify to use with Phonegap Build. In order for it to work smoothly it is important to disable the bouncing nature of the UIWebView. My config.xml file contains the neccessary line to disable it.

-

Example by Tegan Snyder

-
+
+ +
+ Squirrel +

SQUIRREL SAYS HELLO

+

This is an example of a menu that slides down from the top with a swiping motion. The idea was taken from CNN's iPhone app. I tried to model the interaction as close as I could using Javascript and CSS3.

+

Note: This is one of thoose demos that really only shines in a hybrid container. I have included a config.xml file that you can modify to use with Phonegap Build. In order for it to work smoothly it is important to disable the bouncing nature of the UIWebView. My config.xml file contains the neccessary line to disable it.

+

Example by Tegan Snyder

+
+ +
diff --git a/js/main.js b/js/main.js index d3460dc..4345ec9 100644 --- a/js/main.js +++ b/js/main.js @@ -9,6 +9,10 @@ Zepto(function($){ * @menu_btns_container : the container for the default mini-button navigation * */ + + // dynamically set content-scroller height + + $('#content-scroller').height(viewport().height); $('#puller').swipeslide({ min_move_y: Math.abs(parseInt($('#swipemenu nav').css('top').split('px')[0], 10)), @@ -18,4 +22,15 @@ Zepto(function($){ menu_btns_container: 'aside' }); -}); \ No newline at end of file + +}); + +function viewport(){ + var e = window; + var a = 'inner'; + if (!('innerWidth' in window)) { + a = 'client'; + e = document.documentElement || document.body; + } + return { width : e[ a+'Width' ] , height : e[ a+'Height' ] } +} diff --git a/js/swipeslide.min.js b/js/swipeslide.min.js index 24587a9..39bcb80 100644 --- a/js/swipeslide.min.js +++ b/js/swipeslide.min.js @@ -175,6 +175,8 @@ $(config.swipe_menu).css('top', '319px'); $(config.swipe_menu + ' ' + config.nav_container).css('top', '-319px'); + + document.addEventListener('scroll', onScroll, false); }