2 * "fixHeaderFooter" native plugin - Behavior for "fixed" headers,footers, and scrolling inner content
5 (function( $, undefined ) {
7 // Enable touch overflow scrolling when it's natively supported
8 $.mobile.touchOverflowEnabled = false;
10 // Enabled zoom when touch overflow is enabled. Can cause usability issues, unfortunately
11 $.mobile.touchOverflowZoomEnabled = false;
13 $( document ).bind( "pagecreate", function( event ) {
14 if( $.support.touchOverflow && $.mobile.touchOverflowEnabled ){
16 var $target = $( event.target ),
19 if( $target.is( ":jqmData(role='page')" ) ){
21 $target.each(function() {
22 var $page = $( this ),
23 $fixies = $page.find( ":jqmData(role='header'), :jqmData(role='footer')" ).filter( ":jqmData(position='fixed')" ),
24 fullScreen = $page.jqmData( "fullscreen" ),
25 $scrollElem = $fixies.length ? $page.find( ".ui-content" ) : $page;
27 $page.addClass( "ui-mobile-touch-overflow" );
29 $scrollElem.bind( "scrollstop", function(){
30 if( $scrollElem.scrollTop() > 0 ){
31 window.scrollTo( 0, $.mobile.defaultHomeScroll );
37 $page.addClass( "ui-native-fixed" );
41 $page.addClass( "ui-native-fullscreen" );
43 $fixies.addClass( "fade in" );
45 $( document ).bind( "vclick", function(){
47 .removeClass( "ui-native-bars-hidden" )
48 .toggleClass( "in out" )
49 .animationComplete(function(){
50 $(this).not( ".in" ).addClass( "ui-native-bars-hidden" );