发布网友 发布时间:2022-04-24 05:36
共1个回答
热心网友 时间:2022-04-19 07:03
<!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>无标题文档</title>
<script src="jquery-1.3.2.js"></script>
<!-- jquery-1.3.2.js 可以去 http://download.pcpop.com/Down/39992.html 下载,然后注意路径,和你文件可以放一个文件夹中-->
<style>
.pic1{ width:200px; height:100px; background:#666;}
.pic2{ width:200px; height:100px; background:#888; display:none;}
</style>
<script>
$(function(){
$("#select").click(function(){
if($("#select").select().val()=="2"){
$(".pic1").hide();
$(".pic2").show();
}else{
$(".pic2").hide();
$(".pic1").show();
}
})
})
</script>
</head>
<body>
<select id="select">
<option selected="selected">1</option>
<option>2</option>
</select>
<div class="pic1">这是pic1层</div>
<div class="pic2">这是pic2层</div>
</body>
</html>