IE下点击div没反应???

<!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>IE下background-color问题???</title> 
	<script type="text/javascript" src="jquery.min.js"></script> 

	<style type="text/css">
		#div_top{position:relative;width:1000px;height:700px; left:50px;top:50px;border: 1px solid red;}
		.default{position:absolute;width:200px;height:200px;left:120px;top:120px;border: 1px solid red;}
	</style>

	<script type="text/javascript"> 
	  $().ready(function(){
		$('.default').click(function(){
			alert(11111);
		});
	  });
	</script> 
	<style type="text/css"> 

	</style> 
	</head> 

	<body> 
		<div id="div_top" style="background-color:#9999FF;">
			<img src="F:\\picture\\2008111674225421778018.jpg" style="width:1000px;height:700px;"></img>
			<div class="default"></div>
		</div>
	</body> 
</html>


如题,当点击<div class="default">这个div时,在IE下竟然没一点反应。但是在FF和chrome下可以正常弹出“11111”。

于是乎替换<body>里边元素:

		<div id="div_top" style="background-color:#9999FF;">
			<img src="F:\\picture\\2008111674225421778018.jpg" style="width:1000px;height:700px;"></img>
			<div class="default" style="background-color:#9999FF;"></div>
		</div>


这下在IE中可以弹出。也就是在<div class="default"> 加了个 style="background-color:#9999FF;"难道和这个有关系?答案是有一定关系。

比较相当狠郁闷……以前没怎么整过前台的东西,狠是模糊。经过一系列的摸索,发现与<img>标签有关系。如果没有那个图片,不管有没有style="background-color:#9999FF;"都可以弹出信息。


有知道的朋友也可以给予请教。现在正在探索<img>的问题。







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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值