そのため、タイトルは少し大雑把です。私はこの機能を持っており、マウス/ページスクロール(ページの約88ピクセル下)で、「メニューは静的な位置に変更されるため、ブラウザウィンドウの上に留まります...
このように...申し訳ありませんが、私の HTML はフレームワーク内にあり、簡単に共有できません。 http://www.1stwebdesigner.com/wp-content/uploads/2010/06/nagging-menu-with-css3-and-jquery/index.html
ただし、私のものは派手なことは何もしません(上記のデモとは異なります)。少し遅れてからスライドダウンしてください。デモのようなもの。
これが私のjQuery関数です...誰か?
var div = $('#wizMenuWrap');
var editor = $('#main_wrapper');
var start = $(div).offset().top;
$(function fixedPackage() {
$(window).bind("scroll", function () {
// If the modal is displayed, do nothing
if ($('.modal').is(':visible'))
return;
var p = $(window).scrollTop();
$(div).css('position', ((p) > start) ? 'fixed' : 'static');
$(div).css('top', ((p) > start) ? '0px' : '');
//Adds TOP margin to #main_wrapper (required)
$(editor).css('position', ((p) > start) ? 'relative' : 'static');
$(editor).css('top', ((p) > start) ? '88px' : '');
});
});