2017-03-03 48 views
0

我怎样才能使使用转换函数我怎样才能使使用过渡功能时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

请点击'<''创建一个[mcve] - 不清楚你在问什么 – mplungjan

回答

0

您可以使用jQuery淡入时div元素淡出慢()和淡出()

$(".fixed.menu").fadeIn("slow"); 

$(".fixed.menu").fadeOut("slow");