Not all the mobile platform all support fixed position. I have written a project to be mobile friendly with bootstrap 3 and make fixed navbar on scroll. I found iOS5 and after has strong support for fixed positioning but iOS4 and below simply treats elements as static and scrolls them along with the rest of the page.
Javascript Solutions for IOSenjoy it.
//detect is iphone/ipad/iPod and safari version under 6533
//fix navbar-fixed-bttom position
var safari_prefix = false;
var ua = navigator.userAgent;
if (/iPhone|iPad|iPod/i.test(ua) && ua.lastIndexOf("Safari/") > 0) {
var version = ua.substr(ua.lastIndexOf('Safari/') + 7, 4);
//console.log(ua.lastIndexOf('Safari/'));
if (version <= 6533) {
$(".navbar-fixed-bottom").css("position", "static");
safari_prefix = true;
}
}
留言
張貼留言