javascript - Jquery 滑动到可见性隐藏?

标签 javascript jquery css jquery-ui jquery-plugins

我想实现这样的目标:

$("#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/

相关文章:

javascript - 我怎样才能阻止 Javascript 在某一点之后被解释?

javascript - 对于 Greasemonkey 中的这个 jQuery 示例,为什么会触发 alert() 但不会触发 console.log()?

javascript - zXml使用问题

javascript - Golang可以只使用HTML,CSS和JS吗?没有前端框架?

javascript - 谷歌桑基颜色悬停

javascript - 排序日期对象数组错误javascript

javascript - 如何从 ASP.NET 委托(delegate)执行 Response.Redirect

javascript - 如何将mvc View javascript代码传输到单独的js文件

javascript - lint 严格违反使用 (this)

html - 当 <input> 标签上的 "-webkit-appearance: none"和值 =""时,Chrome 中的高度不正确