使用过渡函数
时,如何使div元素淡出变慢
$('.masthead').visibility({
once: false,
onBottomPassed: function() {
$('.fixed.menu').transition('fade in');
$('.fixed.menu').animate({
height: 80
}, 500); //animate the menu to the width of 80
},
onBottomPassedReverse: function() {
$('.fixed.menu').animate({
height: 50
}, 500); //animate the menu back to the original width
$('.fixed.menu').transition('fade out');
}
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="masthead">
<div id="fixed-menu">
</div>
</div>
答案 0 :(得分:0)