JavaScript
- 6 ответов
- 0 вопросов
1
Вклад в тег
$('#box').find('.some-class-for-div').each(function (){
$(this).data('op',$(this).css('opacity'));
})
.mouseover(function (){
$(this).animate({opacity: 1}, 500 );
})
.mouseout(function (){
$(this).stop(true,true).animate({opacity: $(this).data('op')}, 500 );
});
<div id="box">
<div id="des1" class="some-class-for-div">1<img src="imgs/about1.png" id="about1" style="opacity: 0;"></div>
<div id="des2" class="some-class-for-div">2<img src="imgs/about2.png" id="about2" style="opacity: 0;"></div>
<div id="des3" class="some-class-for-div">3<img src="imgs/about3.png" id="about3" style="opacity: 0;"></div>
</div>
.block{
overflow-x:hidden;
width:300px;
float:left;
}
.block:after{
clear:both;
display:table;
content:'';
}
.block img{
height:100%;
}
<div class="block">
<img scr="/fsfsd/img.png" />
</div>