我正在尝试为我的vbulletin皮肤制作一个可扩展/可折叠的侧边栏。这是我的代码:
<script>
jQuery(document).ready(function () {
$(".hide").click(function () {
$("#sidebar").animate({ width: "0px", opacity: 0 }, 500);
$("#sidebar").animate({ padding: "0" }, 500);
$("#sidebar").css("margin", "0");
$("#sidebar").hide;
});
$(".show").click(function () {
$("#sidebar").animate({ width: "150px", opactiy: 100 }, 500);
});
});
</script>
<!--Sidebar Start-->
<table width="$stylevar[outertablewidth]" border="0" cellpadding="0" cellspacing="0" align="center">
<tr>
<td width="150" valign="top" class="page" id="sidebar" style="padding: $stylevar[cellpadding]px;">
<a class="hide" href=#>YOUR CONTENT HERE</a>
<a class="show" href=#>YOUR CONTENT HERE</a>
</td>
</table>
<!--SideBar End -->
我希望边栏完全折叠,因此看起来好像不存在。
另外,我知道使用表不是很好,但这是用vbulletin进行处理的最简单方法。哦,我打算在完成后将.hide和.show从边栏中移出,可能只是在它的左侧。
最后,您可以查看我已经完成的工作Here感谢任何可以提供帮助的人。