10

I've done this in the past using a method similar to this: http://javascriptkit.com/javatutors/static3.shtml

but I don't like the "flicker" effect as the page is scrolled and the div needs to move with the scrolling. Lately I've seen a lot of site that have an element (a div or the like I presume) that don't move when the page is scrolled but it's seemless...they're just there and it's a beautiful thing.

Unfortunately I can't seem to recall where I've seen it lately to view the source and try to figure it out so I figured I'd turn here and see what all of you experts can provide as far as assistance / suggestions.

TIA

4

3 に答える 3

10

要素に「位置:固定」を設定してみてください。

これは一部の IE バージョンでは機能しないと思います。そのためには JS を使用する必要があります。

于 2010-05-18T20:51:37.713 に答える
3

あなたがリンクしたそのサイトは、IE 4 などについてまだ言及していますが、それに依存しない方がよいでしょう。時代遅れです。

を実行することで、CSS を使用して要素を固定位置に配置できますposition: fixed;

于 2010-05-18T20:52:43.590 に答える
-2

グーグルリーダーを見てください。

固定ヘッダー固定サイドバーがあります。

于 2010-05-18T20:53:54.197 に答える