Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/69.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在jQuery中,prepend().hide().fadeIn()不是很平滑吗?_Jquery_Jquery Animate_Jquery Effects - Fatal编程技术网

在jQuery中,prepend().hide().fadeIn()不是很平滑吗?

在jQuery中,prepend().hide().fadeIn()不是很平滑吗?,jquery,jquery-animate,jquery-effects,Jquery,Jquery Animate,Jquery Effects,在jQuery中,下面的操作会不会不那么顺畅 $('<a href= ... ><img src= ... /></a>').prependTo($('#someDiv')).hide().fadeIn() $('').prependTo($('#someDiv')).hide().fadeIn() 它真的会在一瞬间显示添加的元素,然后隐藏它,然后是fadeIn吗 那么动画会不会不那么平滑呢 $('<a href= ... ><img

在jQuery中,下面的操作会不会不那么顺畅

$('<a href= ... ><img src= ...  /></a>').prependTo($('#someDiv')).hide().fadeIn()
$('').prependTo($('#someDiv')).hide().fadeIn()
它真的会在一瞬间显示添加的元素,然后隐藏它,然后是fadeIn吗

那么动画会不会不那么平滑呢

$('<a href= ... ><img src= ...  /></a>').prependTo($('#someDiv')).hide().fadeIn()
有没有更好的方法

还是以下

$('<a style="display:none" href= ... ><img src= ...  /></a>').prependTo($('#someDiv')).fadeIn()
$('').prependTo($('#someDiv')).fadeIn()

$('').hide().prependTo($('#someDiv')).fadeIn()
更新:原来的

$('#someDiv').prepend('<a href= ><img src  /></a>').hide().fadeIn()
$('#someDiv').prepend('').hide().fadeIn()

这实际上可能是隐藏了
#someDiv
,然后将其淡入淡入?

隐藏和淡入淡入淡入淡入淡入淡入淡入淡入淡入淡入淡入淡入淡入淡入淡入淡入淡入淡入淡入淡入淡入淡入淡入淡入淡入淡入淡入淡入淡入淡入淡入淡入淡入淡入淡入淡入淡入淡入淡

$('#someDiv').prepend('<a style="display:none" href= ><img src  /></a>').fadeIn("slow");
$('#someDiv').prepend('').fadeIn(“慢”);

并且应该非常平滑:)

隐藏和淡入类似于在桌子周围运行:)使用第二种方法并使用“slow”参数设置fadeIn,如下所示:

$('#someDiv').prepend('<a style="display:none" href= ><img src  /></a>').fadeIn("slow");
$('#someDiv').prepend('').fadeIn(“慢”);

而且应该非常平滑:)

您可以使用以下命令重新排列它:

$('<a href= ... ><img src= ...  /></a>').hide().prependTo('#someDiv').fadeIn();
$('').hide().prependTo('#someDiv').fadeIn();

这允许您在添加之前调用它,因此没有视觉瑕疵。

您可以使用以下命令稍微重新排列它:

$('<a href= ... ><img src= ...  /></a>').hide().prependTo('#someDiv').fadeIn();
$('').hide().prependTo('#someDiv').fadeIn();

这允许您在添加之前调用它,因此没有视觉瑕疵。

先淡入淡出,然后预加,然后只显示,非常平滑,对吗

$('#someDiv').fadeOut("fast").prepend('<a style="display:none" href= ><img src  /></a>').fadeIn("slow");
$('someDiv').fadeOut(“快”).prepend('').fadeIn(“慢”);

先淡入淡出,然后预涂,然后只显示,非常平滑,对吗

$('#someDiv').fadeOut("fast").prepend('<a style="display:none" href= ><img src  /></a>').fadeIn("slow");
$('someDiv').fadeOut(“快”).prepend('').fadeIn(“慢”);

ah,那么prependTo(“#someDiv”)和prependTo($('#someDiv'))是一样的?@Jian-Yep,它可以直接使用选择器:)啊,那么prependTo(#someDiv”)和prependTo($('#someDiv'))是一样的?@Jian-Yep,它可以直接使用选择器:)