Не отрабатывает позиционирование в случае screen.width >=
Помогите пожалуйста пытаюсь научить ресурс подстраиваться под разрешение юзера а работать оно у меня не хочет....
Воть код:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Yamaha motors</title>
<link href="yamaha.css" rel="stylesheet" type="text/css" />
<link href="yamaha.js" rel="edit" type="text/javascript" />
<script type="text/javascript">
if (screen.width >= 1600) document.getElementById('yamaha').style.left="15%"
document.getElementById('menuholder').style.left="15%"
document.getElementById('mainblocholder').style.left="15%"
document.getElementById('mainblocholder').style.top="56%"
document.getElementById('yamaha').style.top="50px"
document.getElementById(menuholder).style.top="140px";
else if (screen.width >= 1280 && screen.width < 1600) document.getElementById('yamaha').style.left="5%"
document.getElementById('menuholder').style.left="5%"
document.getElementById('mainblocholder').style.left="5%"
document.getElementById('mainblocholder').style.top="46%"
document.getElementById('yamaha').style.top="5px"
document.getElementById(menuholder).style.top="90px";
else if (screen.width >=1024 && screen.width < 1280) document.getElementById('yamaha').style.left="0%" document.getElementById('menuholder').style.left="0%"
document.getElementById('mainblocholder').style.left="0%"
document.getElementById('mainblocholder').style.top="46%"
document.getElementById('yamaha').style.top="5px"
document.getElementById(menuholder).style.top="90px";
</script>
<style>
#mbcg { width: 100%;
height: 100%;
background-image:url(Yamaha-site-mainBCG.PNG);
background-repeat:no-repeat;
background-size: 100%;
position:absolute;
top:0;
left:0;
z-index: 1;
}
#yamaha { position:absolute;
top: 5px;
left:0%;
z-index: 2;}
#menuholder { width:685px;
height:74px;
background-image:url(Yamaha-site-mainv2_03.png);
background-repeat:no-repeat;
position:absolute;
top:90px;
left:0%;
z-index:2;}
#mainblocholder { width:100%px;
height:100%px;
position:absolute;
top:46%;
left:0%;
z-index:2;}
#mainblock { width: 825px;
height:409px;
background-image:url(Yamaha-site-main_11.png);
background-repeat:repeat;
float:left;}
#submenu { width:175px;
height:409px;
background-image:url(Yamaha-site-main013.png);
background-repeat:no-repeat;
float:left}
</style>
</head>
<body>
<div id="mbcg">
<img src="Yamaha-site-main3.png" id="yamaha" />
<div id="menuholder">
</div>
<div id="mainblocholder">
<div id="mainblock">
</div>
<div id="submenu">
</div>
</div>
</div>
[B]</body>[/B]
</html>
Последний раз редактировалось Webkraft, 23.07.2011 в 15:17.
|