Jquery滑动到可见性隐藏?
我想要实现类似的目标:
$("#left").hide('slide', {direction: 'right'}, 1000)
但是我不希望隐藏 div,我希望它保留空间,所以我希望隐藏可见性,例如:
$("#left").css('visibility','hidden')
但仍然达到与上面相同的效果。
I want to achieve something like :
$("#left").hide('slide', {direction: 'right'}, 1000)
However I do not want the div to be hidden I want it to keep up space so I want have the visibility hidden like:
$("#left").css('visibility','hidden')
Yet still achieve the same effect as above.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这就是我要做的
这可能很可怕,但这是我能想到解决问题的唯一方法:)
This is what I'd do
This could be horrible, but it's the only way I could think of solving the problem :)
示例: http://jsfiddle.net/skyrim/j2RWt/4
试试这个:
编辑
所以,在了解实际需求是什么(:p)之后,此方法基本上将另一个 div 放置在原始元素上。我已经在 IE 上进行了测试...在其他浏览器上进行进一步测试后,我将通过更新来编辑它!
编辑
只有 Chrome 似乎在获得正确的高度方面存在问题。
添加了一个回调,该回调删除隐藏可见性(如 LEOPiC 建议)并删除滑出 div
EXAMPLE: http://jsfiddle.net/skyrim/j2RWt/4
Try this:
EDIT
So, after learning what the actual need was (:p), this method basically place another div over the original element. I've tested it on IE...and I'll edit this with an update after I do further testing on other browsers!
EDIT
Only Chrome seems to be having an issue with getting the correct height.
Added a callback which removes the makes visibility hidden (as LEOPiC suggested) and removes the slideout div
您可以用非常简单的方式做到这一点。 这里确实有一个很好的教程< /strong> 以不同方向制作动画。它一定会对你有所帮助。试试这个
例子: http://jsfiddle.net/2p3FK/2/
编辑:< /strong> 另一种解决方案,这非常简单,可以将 div 移出窗口并使用
左边距
示例:http://jsfiddle.net/2p3FK/1/
You can do it in very simple way. There is really a nice tutorial here to animate in different direction. It will surely help you. try this
EXAMPLE : http://jsfiddle.net/2p3FK/2/
EDIT: One more solution, this is very simple to move the div out of window with
left margin
EXAMPLE : http://jsfiddle.net/2p3FK/1/