2012-03-08 6 views
0

のリンクを貼り付けていません。 Firefoxではうまく動作しますが、IEやSafari/Chromeでは動作しません。ウィンドウが小さくなりすぎると、フッターは固定された位置からページの下部に置かれるより流動的なものに切り替わります。スティッキーフッターは、サイトへの

ウィンドウを短くしてページの一番下までスクロールし、スクロールバーが終了するまでページを展開すると、フッターはページの下部の約50〜100ピクセル上に位置します。誰がなぜこれが起こるのか知っていますか?

CSS:

html, body { 
        width: 100%; 
        height: 100%; 
    } 

    #wrap { 
     min-height:100% !important; 
    } 

    #wrap:before { /* Opera and IE8 "redraw" bug fix */ 
     content:""; 
     float:left; 
     height:100%; 
     margin-top:-999em; 
    } 

    #container { 
     position: relative; 
     /*margin: 72px 0 172px 0;*/ 
     top: 72px; 
     bottom: 172px; 
     width: 100%; 
     height: auto; 
     overflow: auto; 
    } 

    #top_navigation { 
     position: fixed; 
     min-width: 1010px; 
     width: 100%; 
     height: 72px; 
     background: url('../images/opaque.png') repeat; 
     text-transform: uppercase; 
     z-index: 2000; 
    } 

    #bottom_navigation { 
     position: fixed; 
     min-width: 1550px; 
     width: 100%; 
     height: 172px; 
     background: url('../images/opaque.png') repeat; 
     text-transform: uppercase; 
    } 

Javascriptを:

int_window_width = $(window).width(); 
    int_window_height = $(window).height(); 

    if ((int_window_width <= int_min_window_width && int_window_height >= int_min_window_height) || int_window_height <= int_min_window_height) { 
     $('html').css('overflow-y', 'scroll'); 
     $('#bottom_navigation').css('bottom', ''); 
     $('#bottom_navigation').css('margin-top', ''); 
     $('#bottom_navigation').css('position', 'relative'); 
    } 

    if ((int_window_width >= int_min_window_width && int_window_height >= int_min_window_height) || int_window_height >= int_min_window_height) { 
     $('html').css('overflow-y', 'hidden'); 
     $('#bottom_navigation').css('position', 'absolute'); 
     $('#bottom_navigation').css('top', ''); 
     $('#bottom_navigation').css('bottom', '0'); 
     $('#bottom_navigation').css('margin-top', ''); 
    } 
+0

このような意味ですか? http://jsfiddle.net/n6NQZ/これは修正されています。ページスクロールに基づいて固定値から絶対値に変更しますか? – Jay

+0

@Jay、デモがIE6で動作しないことは知っていますか? –

+0

これはIE6でも動作しています:http://jsfiddle.net/NDC3L/ – Jay

答えて

1

ドキュメントがスクロールされたときにフッターが移動しないようにしたい場合は、単にposition:fixed; bottom: 0を使用しています。 IE6はposition:fixedをサポートしていませんので、ポリフィルを適用する必要があります:http://www.css-101.org/fixed-positioning/05.php

+0

答えは私の問題を解決しません。ブラウザウィンドウのサイズに基づいて、フッターは固定(大きなサイズのウィンドウ)または絶対ボトム(小さいサイズのウィンドウ)のいずれかである必要があります。あなたが619pxを超えてウィンドウを閉じると、jqueryが正しく起動します。 フッターが絶対的に配置された状態でページの一番下までスクロールし、ウィンドウを展開してもフッターが張られない場合、問題が発生します。それは窓の底の上に50〜100px浮遊します。フォローするリンク:www.bigideaadv.com/xsp –

関連する問題