Липкий нижний колонтитул не прилипает - PullRequest
0 голосов
/ 09 марта 2012

Ссылка на сайт: http://www.bigideaadv.com/xsp

Я пытаюсь заставить нижний колонтитул придерживаться. Работает нормально в 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', '');
    }

1 Ответ

1 голос
/ 09 марта 2012

Если вы хотите, чтобы нижний колонтитул не перемещался при прокрутке документа, просто используйте position:fixed; bottom: 0. IE6 не поддерживает position:fixed, поэтому вам нужно применить полифилл: http://www.css -101.org / fixed-positioning / 05.php

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...