1. 程式人生 > >頁面滿屏效果JS程式碼

頁面滿屏效果JS程式碼

var height = $(window).height();
$("#container").height(height);
$("#bd").css("padding-top",height/2 - $("#bd").height()/2);

$(window).resize(function(){
   var height = $(window).height();
   $("#bd").css("padding-top",$(window).height()/2 - $("#bd").height()/2);
   $("#container").height(height);
   
});