我想实现这样的目标:
$("#left").hide('slide', {direction: 'right'}, 1000)
但是我不想隐藏 div 我希望它保持空间所以我希望隐藏可见性,如:
$("#left").css('visibility','hidden')
但还是达到了上面一样的效果。
最佳答案
这就是我要做的
$parent = $('#left').parent(); //store the parent of the element in a variable
$('#left').clone() //clone the existing element
.appendTo($parent) // insert it into the current position
.css('visibility','hidden') //set it's visibility to hidden
.end().end() //target the initial element
.slideUp() //do any slide/hide/animation that you want here, the clone will always be there, just invisible
这可能很糟糕,但这是我能想到的解决问题的唯一方法:)
关于javascript - Jquery 滑动到可见性隐藏?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8830583/