How does one get a fixed header to stay at the top of the page?

前端 未结 2 1753
挽巷
挽巷 2021-01-24 23:18

The fixed header will not stay at the top of the page for me. It sits on top of a page that has several number inputs that were added via javascript. As the user fills out the

2条回答
  •  说谎
    说谎 (楼主)
    2021-01-24 23:49

    The data-position="fixed" is used to make those smartphone-like headers that disapear with some clicks on body or some other events i dont care,

    for what you want, you can just style your header with css with something like:

    #myheader{
     position: fixed !important;
     width:100%;
     top: 0px;
    }
    

    Works like a charm

    PS: The !important overwrites any jquerymobile attempt to change position attribute, it may not be needed

提交回复
热议问题