سلام دوستان
داشتم یه کد ساده می نوشتم که با رفتن موس روی یه عکس , یه قسمت از یع باکس کوچیک بشه.
ولی نمیدونم چا انتخاب گر درست عمل نمیکنه این کدش:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
</head>
<style type="text/css">
.box{
height:200px;
width:300px;
border:#999 solid 1px;
border-radius:8px;
background-color:#ccc;
}
.hed{
width:100%;
height:32px;
background-color:#333;
border-radius:8px 8px 0 0;
color:#000;
text-align:center;
font-size:18px;
}
.hide{
float:right;
border-radius:0 8px 0 0;
}
</style>
<script type="text/javascript">
$('img[class="hide"]').hover(function(e) {
$("div.box").animate({height:'200px'});
},function(e){
$("div.box").animate({height:'32px'});
$("div.box").css("border-radius","8px 8px 0 0");
});
</script>
</head>
<body>
<div class="box">
<div class="hed">
<img class="hide" src="e1.png"/>
meno
</div>
</div>
</body>
</html>
مشکل از این خطه
$('img[class="hide"]').hover(function(e) {
یعنی وقتی این خط رو به این تغییر میدم
$(document).hover(function(e) {
یعنی با سند اصلی کار میکنم مشکلی پیش نمی آد ولی تو انتخاب گر مورد نظر من مشکل داره یا من اشتباه نوشتم
کسی چیزی میدونه لطفا راهنمایی کنه
ممنون