DR.HTML
شنبه 01 بهمن 1390, 12:15 عصر
سلام من تازه کارم با جی کوئری
این کد رو که نشوتم خودتون ببینید متوجه میشید اما باز یه توضیح میدم میخوام وقتی روی یکی از منو های بالا h1 یا H2 کلیک کرد یکی از زیر منوهای پایینشون نشون بده c1 و C2
و در ابتدای کار c1 نشون داده بشه
میشه توضیح بدید مشکلم کجاست (جی کوئری ) اچ تی ام الشو الکی نوشتم
<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#c2").hide();
$("#h1").click(function(){
$("#c2").hide();
$("#c1").show();
});
$("#h2").click(function(){
$("#c1").hide();
$("#c2").show();
});
</script>
<style>
div{border:1px solid ;}
#h1{width:98px;
height:20px;
float:right;
}
#h2{width:98px;
height:20px;
float:left;
}
#c1{width:198px;
height:392px;
float:right;
}
#c2{width:198px;
height:392px;
float:left;
}
#main{width:202px;
height:415px;
}
</style>
<head>
<body>
<div id="main">
<div id="h1"></div>
<div id="h2"></div>
<div id="c1"></div>
<div id="c2"></div>
</div>
</body>
</html>
این کد رو که نشوتم خودتون ببینید متوجه میشید اما باز یه توضیح میدم میخوام وقتی روی یکی از منو های بالا h1 یا H2 کلیک کرد یکی از زیر منوهای پایینشون نشون بده c1 و C2
و در ابتدای کار c1 نشون داده بشه
میشه توضیح بدید مشکلم کجاست (جی کوئری ) اچ تی ام الشو الکی نوشتم
<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#c2").hide();
$("#h1").click(function(){
$("#c2").hide();
$("#c1").show();
});
$("#h2").click(function(){
$("#c1").hide();
$("#c2").show();
});
</script>
<style>
div{border:1px solid ;}
#h1{width:98px;
height:20px;
float:right;
}
#h2{width:98px;
height:20px;
float:left;
}
#c1{width:198px;
height:392px;
float:right;
}
#c2{width:198px;
height:392px;
float:left;
}
#main{width:202px;
height:415px;
}
</style>
<head>
<body>
<div id="main">
<div id="h1"></div>
<div id="h2"></div>
<div id="c1"></div>
<div id="c2"></div>
</div>
</body>
</html>