jquery mobile和iphone-页面底部的空白
我有一个jquery手机网页。它在桌面浏览器和android上看起来都不错 但在iphone的safari中,我在页面底部有一个奇怪的空白。看起来.ui页面的最小高度有问题,因为空格的高度与safari的标题栏+url栏一样高 有什么想法吗 编辑: 我发现问题在于:jquery mobile和iphone-页面底部的空白,iphone,jquery-mobile,Iphone,Jquery Mobile,我有一个jquery手机网页。它在桌面浏览器和android上看起来都不错 但在iphone的safari中,我在页面底部有一个奇怪的空白。看起来.ui页面的最小高度有问题,因为空格的高度与safari的标题栏+url栏一样高 有什么想法吗 编辑: 我发现问题在于: html, body { overflow-x: hidden !important; position: relative !important; } 我希望这段代码能解决您的问题 // Get heigh
html, body {
overflow-x: hidden !important;
position: relative !important;
}
我希望这段代码能解决您的问题
// Get height of the document
var screen = $(document).height();
// Get height of the header
var header = $('[data-role=header]').height();
// Get height of the footer
var footer = $('[data-role=footer]').height();
// Simple calculation to get the remaining available height
var content = screen - header - footer;
// Change the height of the `content` div
$('[data-role=content]').css({'height': content });
问题在于min.css中的min height属性。 改变 ui页面{最小高度:“400px”}
希望它能起作用:)很抱歉在一个老问题上发帖,但我最近遇到了这个问题 事实证明,这个问题是由人们提供的用于隐藏地址栏的JS函数在某些浏览器中引起的 比如
function hideAddressBar(){
if(document.documentElement.scrollHeight<window.outerHeight/window.devicePixelRatio)
document.documentElement.style.height=(window.outerHeight/window.devicePixelRatio)+'px';
setTimeout(window.scrollTo(1,1),0);
}
window.addEventListener("load",function(){hideAddressBar();});
window.addEventListener("orientationchange",function(){hideAddressBar();});
函数HIDEADDRESBAR(){
如果(document.documentElement.ScrollHeight)它与ui内容
高度有关。当data role=content
与data role=page
具有不同的数据主题时,就会发生这种情况。看起来好像是加载程序div导致了它。请尝试此$('div.ui-loader')。hide();
或删除();
。但是尝试hide();
首先。@左对齐