如何使用jquery mobile以data

编程入门 行业动态 更新时间:2024-10-24 22:24:18
本文介绍了如何使用jquery mobile以data-position =“fixed”固定页眉页脚位置。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在使用jquery mobile和header / footer,我正在使用data-position =fixed。

然而,当我们滚动页面...页眉页脚消失并且在滚动停止时重新出现。是否有一种方法可以让您在滚动时一直显示在屏幕上?

解决方案

我尽力让这个工作。如果你想要,你可以删除将.ui-fixed-overlay改变为.ui-fixed-inline的页眉和页脚类的功能,并从.fade.in和.fade.out中删除webkit动画,但我已经没有锁定防止窗户消失。不过,我相信JQM只会在滚动后重新计算页眉和页脚元素的位置。

我在页面div中放入以下css以移除webkit动画。

.ui固定内联{ opacity:1!important; 显示:block!important; -webkit-animation-name:none!important; } .fade.in,.fade.out { opacity:1!important; -webkit-animation-name:none!important; 显示:block!important; }

我知道这不是你想要的,但它确实加快了页眉和页脚元素的重现(它看起来有点儿)除非您想重写控制页眉和页脚定位的JQM javascript,否则我不认为有任何简单的方法可以做到这一点,因为JQM固定位置代码是在用户滚动后重新定位的。如果找到方法,我会继续寻找并编辑这个答案。

i am using jquery mobile and for header/footer i am using data-position="fixed".

However, when we scroll the page... the header footer goes away ands reappear when scrolling stops.. Is there a way we could just make it fixed on the screen an show all the time you are scrolling ?

I can only think of a way is to apply position fixed and not use jquerymobile for these elements..

解决方案

I tried my best to get this to work. If you want you can delete the function that changes the header and footer class from .ui-fixed-overlay to .ui-fixed-inline and remove the webkit animation from .fade.in and .fade.out, but I've had no lock preventing the windows from disappearing. However, I believe JQM only recalculates the position of the header and footer elements after you scroll.

I put the following css in page div to remove the webkit animation.

.ui-fixed-inline { opacity: 1!important; display:block!important; -webkit-animation-name:none!important; } .fade.in, .fade.out { opacity: 1!important; -webkit-animation-name:none!important; display:block!important; }

I know this is not what you want but it does speed up the reappearance of the header and footer elements (it looks a bit choppy.) Unless you want to rewrite the JQM javascript that controls the header and footer positioning, I don't think there is any easy way to do this as the JQM fixed position code is built to re-position after the user scrolls. I'll keep looking and edit this answer if I find a way.

更多推荐

如何使用jquery mobile以data

本文发布于:2023-10-08 02:52:20,感谢您对本站的认可!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何使用   jquery   data   mobile

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!