What is the simplest jQuery way to have a 'position:fixed' (always at top) div?

后端 未结 6 565
醉梦人生
醉梦人生 2020-11-28 20:39

I\'m relatively new to jQuery, but so far what I\'ve seen I like. What I want is for a div (or any element) to be across the top of the page as if \"position: fixed\" worked

6条回答
  •  萌比男神i
    2020-11-28 21:06

    In a project, my client would like a floating box in another div, so I use margin-top CSS property rather than top in order to my floating box stay in its parent.

提交回复
热议问题