how to 'fix' the header footer position using jquery mobile with data-position=“fixed”

大兔子大兔子 提交于 2019-12-05 11:50:31

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.

A simpler version of Chase's code works fine for me:

/* sass - remove toolbar fade */
.nofade{
 &.in, &.out {
    -webkit-animation-name:none;
 }
}


Note that tap-to-hide toolbars uses this same fade property, so the following is required:

$.mobile.fixedToolbars.setTouchToggleEnabled false  # coffeescript
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!