开发者

How to create a fixed header on a mobile browser

开发者 https://www.devze.com 2023-03-01 20:19 出处:网络
I\'m looking for a JavaScript/jQuery plugin which allows to use a fixed header on mobile browser. iScroll seems to be the most 开发者_如何学运维popular solution but I was interested in a plugin that

I'm looking for a JavaScript/jQuery plugin which allows to use a fixed header on mobile browser.

iScroll seems to be the most 开发者_如何学运维popular solution but I was interested in a plugin that isn't constantly calculating the position of the header while scrolling.

The idea is the same used by jQueryMobile fixed toolbars, while the user is scrolling the header disappears and only reappears after finishing scrolling.


It's more simple than what you think. I use this code:

<div data-role="header" data-position="fixed">
    <h1>Fixed Header!</h1>
</div>

See more info: http://jquerymobile.com/demos/1.2.0/docs/toolbars/bars-fixed.html

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号