Skip to content
This repository
Browse code

Merge pull request #1718 from Wilto/master

Fixed header/footer positioning in IE 7/8
  • Loading branch information...
commit 84d540e53372e2f7aad99e93e68c6dd2cf2d4ddc 2 parents e5876e3 + 86295b1
authored

Showing 1 changed file with 14 additions and 2 deletions. Show diff stats Hide diff stats

  1. 16  js/jquery.mobile.fixHeaderFooter.js
16  js/jquery.mobile.fixHeaderFooter.js
@@ -68,6 +68,19 @@ $.fixedToolbars = (function(){
68 68
 					}
69 69
 				}
70 70
 			})
  71
+			.bind('silentscroll', showEventCallback);
  72
+
  73
+/*		
  74
+		The below checks first for a $(document).scrollTop() value, and if zero, binds scroll events to $(window) instead. If the scrollTop value is actually zero, both will return zero anyway.
  75
+
  76
+		Works with $(document), not $(window) : Opera Mobile (WinMO phone; kinda broken anyway)
  77
+		Works with $(window), not $(document) : IE 7/8
  78
+		Works with either $(window) or $(document) : Chrome, FF 3.6/4, Android 1.6/2.1, iOS
  79
+		Needs work either way : BB5, Opera Mobile (iOS)
  80
+
  81
+*/
  82
+
  83
+		(( $(document).scrollTop() == 0 ) ? $(window) : $(document))
71 84
 			.bind('scrollstart',function(event){
72 85
 				scrollTriggered = true;
73 86
 				if(stateBefore == null){ stateBefore = currentstate; }
@@ -93,8 +106,7 @@ $.fixedToolbars = (function(){
93 106
 					$.fixedToolbars.startShowTimer();
94 107
 				}
95 108
 				stateBefore = null;
96  
-			})
97  
-			.bind('silentscroll', showEventCallback);
  109
+			});
98 110
 
99 111
 			$(window).bind('resize', showEventCallback);
100 112
 	});

0 notes on commit 84d540e

Please sign in to comment.
Something went wrong with that request. Please try again.