【问题标题】:JQM fixed footer "floating"JQM 固定页脚“浮动”
【发布时间】:2017-04-20 02:16:04
【问题描述】:

在 JQM 中,我希望有一个固定的页脚,但同时有一个页面的最大宽度(左侧的内容)。在我添加 data-position="fixed" (固定页脚)之前它工作正常。页脚现在填充整个窗口,而不仅仅是 480 像素。这是好的还是一个错误?任何想法如何解决这个问题?

    <div data-role="footer" data-theme="a"  data-position="fixed"><h1> </h1>
    </div>

JS:

$(document).ready(function(){ 
if ($(window).width() > 480) {
    $('#page1, #gubbo').css('width', '480px' );
}         
});

$(window).resize(function() {
if ($(window).width() <= 480) {
    $('#page1, #gubbo').css('width', '' );
} else {
    $('#page1, #gubbo').css('width', '480px' );
}
});

【问题讨论】:

  • 哪个元素获得了“gubbo” id?
  • gubbo 是多页中的一页。第 1 页是另一个。

标签: jquery html jquery-mobile


【解决方案1】:

我发布到 jQuery 论坛,答案是固定页脚不被视为页面的一部分,即使它仍然“在”data-role="page" 内。所以解决方案应该是添加例如每个页脚的 id 并将该 id 添加到上面的 JS 中

【讨论】:

    猜你喜欢
    • 2015-12-23
    • 2012-12-15
    • 2011-08-31
    • 2012-02-18
    • 2013-07-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多