根据工具栏大小调整网页大小

时间:2012-06-26 20:51:45

标签: css internet-explorer resize

我设法解决了我的第一个问题,即将所有div固定在水平布局上。现在我的新问题是关于Internet Explorer 8.似乎页面的高度较小&导致底部横幅向上移动到内容区域。我发现修复此问题的唯一方法是删除IE8上的大多数工具栏。但是如果用户拥有所有工具栏呢?如何在IE8中激活部分,全部或全部工具栏的情况下,窗口是否适合所有用户?

HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<!-- saved from url=(0017)http://localhost/ -->
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>My Test Site</title>
<meta content="" name="description">
<meta content="," name="keywords">
<meta content="index, nofollow" name="robots">
<meta content="" name="google-site-verification">
<link href="css/layout.css" rel="stylesheet" type="text/css">
<link href="css/navbar.css" rel="stylesheet" type="text/css">
<link href="favicon.ico" rel="shortcut icon" type="image/x-icon">
<link href="favicon.png" rel="icon" type="image/png"><!--[if gt IE 7]>
<link rel="stylesheet" type="text/css" href="css/ie8.css" />
<![endif]-->

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"      
<type="text/javascript">
</script>
<script src="js/jquery.scrollTo-1.4.2.js" type="text/javascript">
</script>
<script type="text/javascript">
$(document).ready(function() {

    $('a.panel').click(function () {

            $('a.panel').removeClass('selected');
            $(this).addClass('selected');

            current = $(this);

            $('#wrapper').scrollTo($(this).attr('href'), 50);              

            return false;
    });

    $(window).resize(function () {
            resizePanel();
    });

});

function resizePanel() {

    width = $(window).width();
    height = $(window).height();

    mask_width = width * $('.item').length;

    $('#debug').html(width  + ' ' + height + ' ' + mask_width);

    $('#wrapper, .item').css({width: width, height: height});
    $('#mask').css({width: mask_width, height: height});
    $('#wrapper').scrollTo($('a.selected').attr('href'), 0);
    }        
</script>
</head>
<body>
<div id="wrapper">
<div id="mask">
<div class="item" id="item1"><a class="img" href="/"><img alt="My Bookmarks"   
height="64" id="logo" name="logo" src="http://i50.tinypic.com/nghgg.png"></a>
<div id="top_banner"><script type="text/javascript">
                pb_cid='BAYBANNER468X60_1';
                pb_type='banner_468x60';
</script> <script src="http://clkads.com/banners/script/include_img_banner.js"    
type="text/javascript">
</script></div>
<div id="navwrapper">
<ul class="floatleft" id="nav">
<li><a href="#">Home</a></li>
</ul>
<br class="clear"></div>
<div id="left_banner"><script type="text/javascript">
                pb_cid='BAYBANNER120X600_1';
                pb_type='banner_120x600';
</script> <script src="http://clkads.com/banners/script/include_img_banner.js"  
type="text/javascript">
</script></div>
<div class="content">
<div id="right_banner"><script type="text/javascript">
                    pb_cid='BAYBANNER120X600_1';
                    pb_type='banner_120x600';
</script> <script src="http://clkads.com/banners/script/include_img_banner.js"   
type="text/javascript">
</script></div>
<div id="bottom_banner"><script type="text/javascript">
                    pb_cid='BAYBANNER728X90_2';
                    pb_type='banner_728x90';
</script><script src="http://clkads.com/banners/script/include_img_banner.js" 
type="text/javascript">
</script></div>
<div class="right_arrow"><a class="panel" href="#item2"><img alt="arrow" height="24"   
src="http://i48.tinypic.com/2rcy1zp.png" width="24"></a></div>
<div id="footer">Copyright 2012 All Rights Reserved | <a href="">Privacy Policy</a> | 
<a href="">Terms of Use</a></div>
</div>
</div>
<div class="item" id="item2">
<div class="content">
<div class="left_arrow"><a class="panel" href="#item1"><img alt="arrow" 
height="24"     
src="http://i49.tinypic.com/2i7obnq.png" width="24"></a></div>
<div class="right_arrow"><a class="panel" href="#item3"><img alt="arrow"    
height="24"     
src="http://i48.tinypic.com/2rcy1zp.png" width="24"></a></div>
</div>
</div>
<div class="item" id="item3">
<div class="content">
<div class="left_arrow"><a class="panel" href="#item2"><img alt="arrow" height="24"    
src="http://i49.tinypic.com/2i7obnq.png" width="24"></a></div>
<div class="right_arrow"><a class="panel" href="#item4"><img alt="arrow"   
height="24"     
src="http://i48.tinypic.com/2rcy1zp.png" width="24"></a></div>
</div>
</div>
</div>
</div>
</body>
</html>

CSS

body {
height : 100%;
width : 100%;
margin : 0;
padding : 0;
overflow : hidden;
}
#wrapper {
width : 100%;
height : 100%;
position : absolute;
top : 0;
left : 0;
background-color : #ffffff;
overflow : hidden;
}
#mask {
width : 500%;
height : 100%;
background-color : #ffffff;
}
.item {
width : 20%;
height : 100%;
float : left;
background-color : #b4d8e7;
}
.content {
width : 969px;
height : 590px;
margin : 0 auto;
background-color : #000000;
position : relative;
top : 125px;
}
.selected {
background : #fff;
font-weight : 700;
}
.clear {
clear : both;
}
a img {
border : none;
display : block;
}
a {
outline : 0;
}
html {
overflow : auto;
}

#navwrapper {
background-color:#000;
left:0;
top:80px;
width:100%;
position:fixed;
}

#nav {
font-family:Arial, Helvetica, sans-serif;
font-size:12px;
padding-top:4px;
}

#nav,#nav ul {
list-style:none;
font-family:Arial, Helvetica, sans-serif;
margin:0;
padding:0;
}

#nav a {
display:block;
color:#ccc;
text-decoration:none;
padding:7px;
}

#nav a.dmenu:hover {
color:#36C !important;
background-color:#fff !important;
}

#nav li {
float:left;
position:static;
width:auto;
}

#nav li ul {
position:absolute;
display:none;
margin-left:-1px;
padding-bottom:10px;
background-color:#FFF;
border:1px solid #bbb;
border-top:none;
box-shadow:0 0 5px #ddd;
z-index:5000;
}

#nav li:hover a,#nav a:focus,#nav a:active {
color:#fff;
background:#444;
text-decoration:none;
padding:7px;
}

#nav li ul,#nav ul li {
width:10em;
}

#nav ul li a {
color:#36C !important;
border-right:0;
}

#nav ul li a:hover {
color:#36C !important;
background-color:#eef3fb !important;
border-right:0;
}

#nav li:hover ul {
display:block;
}

#nav li:hover ul a {
color:#000;
background-color:transparent;
}

#nav ul a:hover {
background-color:#606060 !important;
color:#FFF !important;
}

.menuseprator {
border-bottom:1px solid #ddd;
margin:10px 0;
}

.arrowdown {
font-size:0.5em;
}

.floatleft {
float:left;
}

.floatright {
float:right;
}

.clear {
clear:both;
}

#top_banner {
width : 468px;
height : 60px;
right : 1px;
position : fixed;
overflow : hidden;
padding : 10px;
}
#left_banner {
width : 120px;
height : 600px;
left : 1px;
top : 110px;
position : fixed;
overflow : hidden;
padding : 10px;
}
#right_banner {
width : 120px;
height : 600px;
right : 1px;
top : 110px;
position : fixed;
overflow : hidden;
padding : 10px;
}
#bottom_banner {
bottom : 50px;
right : 260px;
height : 90px;
width : 728px;
position : fixed;
z-index : 999;
margin : 0;
}
.right_arrow {
height : 24px;
width : 24px;
right : 0;
bottom : -30px;
border : none;
position : absolute;
padding : 0;
}
.left_arrow {
height : 24px;
width : 24px;
left : 0;
bottom : -30px;
border : none;
position : absolute;
padding : 0;
}
#logo {
left : 10px;
top : 8px;
border : 0;
height : 64px;
width : 64px;
position : fixed;
}
#footer {
bottom : 5px;
left : 476px;
font-family : Arial, Helvetica, sans-serif;
font-size : 11px;
text-align : center;
color : #6e6e6e;
position : fixed;
}

jquery.scrollTo-1.4.2.js

ps我还注意到导航栏在ie8中没有伸展100%,右侧有几个像素短。这通常吗?

0 个答案:

没有答案