所以我有 3 张图片需要链接到其他页面,并通过悬停淡入。但是我注意到一旦图像在 CSS 中排列成一个块,jquery 影响就会被禁用。和解决方案?
CSS:
div {
display: none;
width: 600px;
margin: auto;
}
.row_1 img{
width: 300px;
height: 300px;
}
.row_2 img{
width: 150px;
height: 150px;
}
.row_1,
.row_2{
display: inline-block;
}
.row_2 img{
display: block;
}
.row_1 img{
display: block;
}
html代码:
<div>
<h2>Blog</h2>
<div class ="row">
<span class ="row_1">
<a href="#"><img src="image/under.png" /></a>
</span>
<span class ="row_2">
<a href='#'><img src="image/under.png" /></a>
<a href="#"><img src="image/under.png" /></a>
</span>
</div>
</div>
jQuery:
$(document).ready(function(){
$('a').fadeTo(1,0.5);
$('a').hover(
function () {
$(this).fadeTo('slow',1);
},
function () {
$(this).fadeTo('slow',0.5);
}
);
});
$(document).ready(function(){
$('div').fadeIn('slow');
});