1

これを機能させるのに問題があります。現在、section[role="main"] を適切に高さにリサイズしているのですが、ウィンドウを小さくリサイズすると途切れてしまいます。

<script type="text/javascript">
    $(function(){
        $('section[role="main"]') .css({'height': (($(window).height()))+'px'});
        $(window).resize(function(){
            $('section[role="main"]') .css({'height': (($(window).height()))+'px'});
        });
    });
</script>

フッターの高さをどのように補正するのかも疑問に思っていますか?現在のところ、フッターを画面外に押し出しています。

助けてくれてありがとう!

パトリック(更新) ?

    <script type="text/javascript">
        $(function(){
            $(window).resize(function(){
                var winheight = $(window).height();
                var heightMinusFooter = winheight - jQuery("#footer").height();
                $('section[role="main"]') .css({'height': heightMinusFooter+'px'});
            });
        });
    </script>
4

1 に答える 1

0

ウィンドウの高さからフッターの高さを差し引いて適用します。

$(window).resize(function(){
    var winheight = $(window).height();
    var heightMinusFooter = winheight - jQuery("#footer").height();
    $('section[role="main"]') .css({'height': heightMinusFooter+'px'});
});
于 2013-08-04T21:43:57.510 に答える