最后,如果找到我需要的正确 jquery 脚本。
但我想改变效果,现在它来自左上角,我想让它滑到左边。
这是代码:
<script type="text/javascript">
$(document).ready(function() {
//add the click event to each element with the toggle class
$('a.toggle').click(function(){
if ($(document).data("toggle-id")) {
//item was already selected, hide it
$("div.toggle#" + $(document).data("toggle-id")).hide(1000);
}
//save the new id for later, then show it
$(document).data("toggle-id", $(this).text().toLowerCase());
$("div.toggle#" + $(document).data("toggle-id")).show(1000)
});
});
</script>