当移动到下一页时页脚隐藏
我有这样的html结构
<div data-role="page" data-theme="b">
<div data-role="header" data-theme="b">
<h1>header</h1>
</div><!-- /header -->
<div data-role="content" data-theme="b">
<a href="#p2" data-role="button" data-icon="arrow-r" data-theme="b" data-iconpos="right">next pagey</a>
</div><!-- /content -->
<div data-role="footer" data-theme="b" data-position="fixed">
<h1>Footer</h1>
</div><!-- /footer -->
</div><!-- /page -->
<div id="p2" data-role="page" data-theme="b">
<div data-role="header" data-theme="b">
<h1>header</h1>
</div><!-- /header -->
<div data-role="content" data-theme="b">
<h1>Content</h1>
</div><!-- /content -->
<div data-role="footer" data-theme="b" data-position="fixed">
<h1>Content</h1>
</div><!-- /footer -->
</div><!-- /page -->
但是当我单击下一页时,下一页会在标题中自动添加后退btn,当我单击后退按钮时,上一页会出现,但页脚会消失..
在FF中工作正常,但在ipad中不行模拟器
I have html structure like this
<div data-role="page" data-theme="b">
<div data-role="header" data-theme="b">
<h1>header</h1>
</div><!-- /header -->
<div data-role="content" data-theme="b">
<a href="#p2" data-role="button" data-icon="arrow-r" data-theme="b" data-iconpos="right">next pagey</a>
</div><!-- /content -->
<div data-role="footer" data-theme="b" data-position="fixed">
<h1>Footer</h1>
</div><!-- /footer -->
</div><!-- /page -->
<div id="p2" data-role="page" data-theme="b">
<div data-role="header" data-theme="b">
<h1>header</h1>
</div><!-- /header -->
<div data-role="content" data-theme="b">
<h1>Content</h1>
</div><!-- /content -->
<div data-role="footer" data-theme="b" data-position="fixed">
<h1>Content</h1>
</div><!-- /footer -->
</div><!-- /page -->
But when i click on next page and next page comes in with auto-added back btn in header, when I click on back button previous page appears but footer dissappears..
in FF working ok, but not in ipad simulator
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
让固定页脚发挥作用对于 JQM 团队来说是一件痛苦的事情。我认为这只是另一个由不可预见的情况引起的小错误。好吧,没关系......
一点见解:
那些该死的移动浏览器不支持固定CSS定位,所以这是通过javascript和绝对位置完成的(以及大量的黑客 - 我敢打赌)
这应该已经给你一个线索......
如果该行为不仅仅针对模拟器(很有可能!),并且在您用内容填充页面后问题仍然存在(我的意思是 - 完成编写应用程序),那么您需要做的就是启动重新定位页脚的代码。我会这样做:
orientationchange 事件应该起作用。如果方向更改导致任何新问题,您还可以尝试
调整大小
。Getting fixed footers to work is a pain for the JQM team. I think it's just another little bug that is caused by unforseen circumstances. Well, nevermind...
A bit of insight:
Those darn mobile browsers have no support of fixed CSS positioning, so this is done with javascript and absolute position (and a ton of hacks - I bet)
This should already give you a clue...
If the behaviour isn't specific just to the emulator (quite possible!) and the problem remains after you fill the page with contents (I mean - finish writing the application) then all you need to do is to kickstart the code that repositions the footer. I'd do it like that:
The orientationchange event should work. You can also try
resize
if orientationchange causes any new problems.