当用户.mouseenters .container我想要链接到fadeIn,并且当用户.mouseleaves .container我想链接到fadeOut。到目前为止,这是工作。我如何减缓过渡?使用5000-10000似乎仍然太快。Jquery - FadeIn()效果不能在脚本循环中工作
$(document).ready(function() {
$('.container').mouseenter(function(){
// When mouse enters the .container, #facial slides to center of .container.
$('#facial').animate({right: '25%'})
// After #facial slides to center it delays for 500ms.
.delay(500)
// After #facial delays it expands it's width to 100% of .container.
.animate({right: 0, width: '100%'});
// show the span link at bottom as a H2 with center aligned.
$('span').fadeIn('slow');
});
$('.container').mouseleave(function(){
// Mouse leaves .container, and span fades out slowly.
$('span').css('display','none');
$('span').fadeOut('slow');
// Mouse leaves the .container, #facial shrinks it's width to 50%.
// #facial slides back to right of .container.
$('#facial').animate({right: 0, width: '50%'});
});
});
好吧...所以它似乎正确后,我发布这个我搞砸了我的代码。我将faceIn()更改为'slow',并修复了循环。有谁知道我可以如何减缓过渡?这对我来说似乎太快了,当我尝试改为5000时,它仍然太快了。 – StinkyTofu
试试这个:https://jsfiddle.net/sy4pv8z3/51/ – DinoMyte