js 模仿google extension网站

 

<!DOCTYPE html >
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript" src="jquery-1.4.2.js"></script>
<script type="text/javascript">
		$(function(){
				
				
				// $("div_left1").css("top",0);
				// $("div_left1").css("left",$("#div_left").position().left+$("#div_left").width());
				$("#div_right").width($(document).width()-442);	//442表示div_left:300+docuemnt.padding的宽度+div_left.padding的宽度
				$("#div_center").width($(document).width()-442);
				$("#div_right").css("left",$("#div_left").width()+50+5+20);		//50表示body.padding 距离左边5px	20表示div_left.padding 
				$("#div_center").css("left",$("#div_left").width()+50+5+20);	
				$("#div_center").css("top",$("#div_right").height()+2);
				$(window).bind('resize',function(){
					$("#div_right").width($(document).width()-442);	//442表示div_left:300+docuemnt.padding的宽度+div_left.padding的宽度
					$("#div_center").width($(document).width()-442);
					$("#div_right").css("left",$("#div_left").width()+50+5+20);		//50表示padding 距离左边5px
				$("#div_center").css("left",$("#div_left").width()+50+5+20);		
					$("#div_center").css("top",$("#div_right").height()+2);
				});
		});
		
</script>
</head>

<body style="margin:0px;padding:0px 50px 0px 50px;text-align:center">

		

			
			<div id="div_left" style="border:1px solid #99bbe8;background-color:#ececec;width:300px;height:100%;float:left;margin:0px;position: fixed; top:0px;
				padding:10px 10px 10px 10px;z-index:1000">
				<div style="width:278px;height:20px;border:1px solid #ff0000;margin-top:10px;font-famliy:font-family:微软雅黑;cursor:hand;text-align:left;padding-left:10px">第一商店</div>
				<div style="width:278px;height:20px;border:1px solid #ff0000;margin-top:10px;font-famliy:font-family:微软雅黑;cursor:hand;text-align:left;padding-left:10px">第二商店</div>
				<div style="width:278px;height:20px;border:1px solid #ff0000;margin-top:10px;font-famliy:font-family:微软雅黑;cursor:hand;text-align:left;padding-left:10px">第三商店</div>
				<div style="width:278px;height:20px;border:1px solid #ff0000;margin-top:10px;font-famliy:font-family:微软雅黑;cursor:hand;text-align:left;padding-left:10px">第四商店</div>
				<div style="width:278px;height:20px;border:1px solid #ff0000;margin-top:10px;font-famliy:font-family:微软雅黑;cursor:hand;text-align:left;padding-left:10px">第五商店</div>
				<div style="width:278px;height:20px;border:1px solid #ff0000;margin-top:10px;font-famliy:font-family:微软雅黑;cursor:hand;text-align:left;padding-left:10px">第六商店</div>
			</div>
			<div id="div_right" style="border:1px solid #99bbe8;height:100px;position: fixed; top:0px;margin-right:50px;background-color:#99bbe8;z-index:100;"></div>
			<div id="div_center" style="border:1px solid #ff0000;height:2000px;position:absolute;;background-color:#ececec;">
				
				<div style="width:100%;height:1000px;">
					<div id="div_center" style="border:1px solid #ff0000;height:150px;width:100%"></div>
					<div id="div_center" style="border:1px solid #ff0000;height:150px;width:100%"></div>
					<div id="div_center" style="border:1px solid #ff0000;height:150px;width:100%"></div>
					<div id="div_center" style="border:1px solid #ff0000;height:150px;width:100%"></div>
					<div id="div_center" style="border:1px solid #ff0000;height:150px;width:100%"></div>
					<div id="div_center" style="border:1px solid #ff0000;height:150px;width:100%"></div>
					<div id="div_center" style="border:1px solid #ff0000;height:150px;width:100%"></div>
					<div id="div_center" style="border:1px solid #ff0000;height:150px;width:100%"></div>
				</div>
				
			</div>
			

	
</body>
</html>
 
//右右拉动还有问题;有待研究

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值