2
我想在页面加载时添加一些动画。我尝试了几次,但没有成功。你能帮我用jquery破解吗?在页面加载时添加动画(从左/右滑动等)
HTML & jQuery的部分:
<div class="MainPozEstate"><a href=""><img src="assets/img/mrk-sng.png" alt="Acarkent Markavilla"/></a></div>
<script type="text/javascript">
jQuery(document).ready(function($) {
$(".MainPozEstate a").mouseover(function() {
$(this).children("img").stop(true, true).animate({
opacity: 0.6
}, 200, "swing", function() {
$(this).animate({
opacity: 1
}, 400);
});
});
});
</script>
CSS线:
.MainPozEstate {float:left;width:980px;margin:0px auto;padding-top:30px;text-align:center;}
.MainPozEstate img {border:none;margin:0px auto;}
感谢。
它看起来像你的动画触发'mouseover',而不是在页面加载时。这是打算吗? – greener