浏览器窗口高度= div高度 - 80px

时间:2014-03-27 18:07:05

标签: jquery wordpress

我正在尝试制作一个模板,其中我有一个高度为80px的标题栏。然后是一个高度等于浏览器窗口高度的滑块。 为了将滑块高度设置为等于浏览器窗口高度,我使用以下jQuery代码。

 jQuery(function(){
    jQuery('#sequence') .css({'height': ((jQuery(window).height()))+'px'});
    jQuery(window).resize(function(){
        jQuery('#sequence') .css({'height': ((jQuery(window).height()))+'px'});
    });
});

它运作良好&重新调整滑块高度。我的标题栏高度为80px,我想重新调整我的滑块高度。

  

浏览器窗口高度=滑块高度 - 80px(标题栏高度)

提前致谢。

1 个答案:

答案 0 :(得分:0)

css({ 'height': ((jQuery(window).height()) - 80) + 'px'});

相关问题