我怎样才能使div从折叠状态变为展开状态(反之亦然),却又从右向左移动呢?
我在那里看到的大多数东西总是从左到右。
从右向左滑动?
我怎样才能使div从折叠状态变为展开状态(反之亦然),却又从右向左移动呢?
我在那里看到的大多数东西总是从左到右。
第2421篇《从右向左滑动?》来自Winter(https://github.com/aiyld/aiyld.github.io)的站点
我这样做是这样的:
var btn_width = btn.width();
btn.width(0);
btn.show().animate({width: btn_width}, {duration: 500});
请注意,节点“ btn”应在动画之前隐藏,并且您可能还需要为其设置“ position:absolute”。
用这个
<script src="jquery.min.js"></script>
<script src="jquery-ui.min.js"></script>
<script>
$(document).ready(function(){
$("#flip").click(function () {
$("#left_panel").toggle("slide", { direction: "left" }, 1000);
});
});
</script>
这可以使用jQueryUI隐藏/显示方法本地实现。例如。
// To slide something leftwards into view,
// with a delay of 1000 msec
$("div").click(function () {
$(this).show("slide", { direction: "left" }, 1000);
});
相似问题
问题类别
An example of right to left animation without jQuery UI, just with jQuery (any version, see https://api.jquery.com/animate/).