Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/90.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 如何使用jquerymobile制作粘性页脚?_Html_Mobile_Css_Jquery Mobile - Fatal编程技术网

Html 如何使用jquerymobile制作粘性页脚?

Html 如何使用jquerymobile制作粘性页脚?,html,mobile,css,jquery-mobile,Html,Mobile,Css,Jquery Mobile,我希望我的页脚总是粘在屏幕的底部,除非有足够的页面内容填满屏幕。在这种情况下,内容应该优先,并将页脚从底部推出(这样你就必须滚动才能看到它) 以下是所需行为的示例: 说清楚一点,我知道,它们不是我想要的,因为当有大量内容时,它们会占用宝贵的屏幕空间。我最接近的是以下CSS规则: [data-role=footer] { bottom: 0; position: absolute; width: 100%; } 如果你知道更好的方法,请发布一个答案 可能您应该尝试在Jq

我希望我的页脚总是粘在屏幕的底部,除非有足够的页面内容填满屏幕。在这种情况下,内容应该优先,并将页脚从底部推出(这样你就必须滚动才能看到它)

以下是所需行为的示例:


说清楚一点,我知道,它们不是我想要的,因为当有大量内容时,它们会占用宝贵的屏幕空间。

我最接近的是以下CSS规则:

[data-role=footer] {
    bottom: 0;
    position: absolute;
    width: 100%;
}

如果你知道更好的方法,请发布一个答案

可能您应该尝试在JqMobile中固定全屏或非全屏,但固定页眉和页脚

在jqMobile中,添加了此功能,它是webapp开发人员在其中最具活力的功能

看一看

您还可以通过添加类为空间问题应用自定义css…

我的最佳解决方案:

$(document).ready(function(){
    $("html, body, .ui-page").height($(window).height());
}
希望这有帮助