Add files via upload
This commit is contained in:
21
z_daisy/hook/thread_js.htm
Normal file
21
z_daisy/hook/thread_js.htm
Normal file
@@ -0,0 +1,21 @@
|
||||
<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>
|
Reference in New Issue
Block a user