【发布时间】:2011-07-02 07:49:29
【问题描述】:
我正在尝试滑动 jquery .slideToggle,但我无法在单击 div(导航)时从左到右或从右到左添加方向。请帮帮我,下面是我的代码。
<!DOCTYPE html>
<html>
<head>
<style>
p { width:400px; float:right;background:#e4e4e4; margin:5px;padding:5px;}
</style>
<script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<body style="font-size:10px; color:#333;">
<div style="width:50px; height:15px;float:right;background:#ccc;border:1px solid #333;text-align:center;">Nav</div>
<p>
This is the paragraph to end all paragraphs. You
should feel <em>lucky</em> to have seen such a paragraph in
your life. Congratulations!
</p>
<script>
$("div").click(function () {
$("p").slideToggle("slow");
});
</script>
</body>
我是 jquery 新手,非常感谢您的帮助。
【问题讨论】:
-
slideToggle 的默认行为是向上滑动或向下滑动。你想让你的
向左滑动和向右滑动吗?
标签: jquery slidetoggle