2014-12-30 4 views
0
var wh = $(document.documentElement.clientHeight).height(); 
var tH = $('.a_Top').height(); 
var bH = $('.a_BottomBar_b').height(); 
$('.a_ContentOuter').css('min-height',(wh)+'px'); 
$('.a_ContentInner').css('min-height',(wh-(tH+bH+29))+'px'); 

나는이 코드를 함수에서 작성하고 있지만 Firefox에서이 페이지를 열면 오류가 발생하며이 코드 전체에 대해 의견을 말하면 제안 사항을 찾아서 찾도록 도와주세요. 이 코드를 사용할 올바른 방법을 찾으십시오 ....브라우저 창 크기로 작업하는 방법은 무엇입니까?

+5

"_it는 오류가 발생했습니다."- 무슨 오류가 있습니까? 받고있는 오류를 게시하십시오. –

+2

'$ (window) .height()'를 사용해야합니다. –

+2

'document.documentElement.clientHeight'는 숫자이며, jQuery 객체를 만드는 방법은 무엇입니까? – Teemu

답변

3

$ (창). 높이();를 추가하십시오.

var wh = $(window).height(); 
var tH = $('.a_Top').height(); 
var bH = $('.a_BottomBar_b').height(); 
$('.a_ContentOuter').css('min-height',(wh)+'px'); 
$('.a_ContentInner').css('min-height',(wh-(tH+bH+29))+'px'); 
alert($('.a_ContentOuter').css('min-height')); 
관련 문제