21 lines
919 B
HTML
21 lines
919 B
HTML
|
<script type="text/javascript">
|
||
|
/*判断可显示区域高度 用于决定显示主图的高度*/
|
||
|
var getBgHeight = function(windowHeight, bannerHeight, mobileBannerHeight){
|
||
|
windowHeight = windowHeight || 560;
|
||
|
if (windowHeight > window.screen.availHeight) {
|
||
|
windowHeight = window.screen.availHeight;
|
||
|
}
|
||
|
bannerHeight = bannerHeight.trim();
|
||
|
mobileBannerHeight = mobileBannerHeight.trim();
|
||
|
if (window.innerHeight > window.innerWidth) {
|
||
|
bannerHeight = parseFloat(mobileBannerHeight);
|
||
|
} else {
|
||
|
bannerHeight = parseFloat(bannerHeight);
|
||
|
}
|
||
|
bannerHeight = Math.round(windowHeight * bannerHeight / 100);
|
||
|
return bannerHeight;
|
||
|
};
|
||
|
var head = $("#masthead");
|
||
|
var bgHeight = getBgHeight(window.innerHeight, '65', '45');
|
||
|
head.css('height', bgHeight + "px");
|
||
|
</script>
|