Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Commit

Permalink
Merge pull request #1718 from Wilto/master
Browse files Browse the repository at this point in the history
Fixed header/footer positioning in IE 7/8
  • Loading branch information
Scott Jehl committed May 26, 2011
2 parents e5876e3 + 86295b1 commit 84d540e
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions js/jquery.mobile.fixHeaderFooter.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,19 @@ $.fixedToolbars = (function(){
}
}
})
.bind('silentscroll', showEventCallback);

/*
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.
Works with $(document), not $(window) : Opera Mobile (WinMO phone; kinda broken anyway)
Works with $(window), not $(document) : IE 7/8
Works with either $(window) or $(document) : Chrome, FF 3.6/4, Android 1.6/2.1, iOS
Needs work either way : BB5, Opera Mobile (iOS)
*/

(( $(document).scrollTop() == 0 ) ? $(window) : $(document))
.bind('scrollstart',function(event){
scrollTriggered = true;
if(stateBefore == null){ stateBefore = currentstate; }
Expand All @@ -93,8 +106,7 @@ $.fixedToolbars = (function(){
$.fixedToolbars.startShowTimer();
}
stateBefore = null;
})
.bind('silentscroll', showEventCallback);
});

$(window).bind('resize', showEventCallback);
});
Expand Down

0 comments on commit 84d540e

Please sign in to comment.