-3
我需要幫助製作向右滑動以顯示更多內容的垂直導航欄。 我正瞄準類似於藍色條的東西:http://www.teehanlax.com/labs/。當側面導航欄被點擊時,導航欄滑出(向右),並在單擊x
按鈕時滑回(向左)。滑動側導航欄
我的代碼是:
<!--Am I implementing the jQuery right?-->
<!DOCTYPE HTML> <html> <head> <title>Nishad</title>
<link rel="stylesheet" href="style.css">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"> </script>
$(function() { $('#nav').click(function()
{ var leftMargin = ($(this).css('margin-left') === '0px') ? '-150px' : '0px'; $(this).animate({ 'margin-left' : leftMargin }, 500);
});
});
</head> <body> <div id="wrapper">
<div id="nav"></div>
<div id="content"></div>
</div> </body> </html>
[你有什麼試過?](http://whathaveyoutried.com)你有哪些麻煩? – Zhihao 2012-08-13 01:13:08
我已經構建了整個酒吧,但我不知道JavaScript是否足以讓它在點擊按鈕時滑出。 – Art 2012-08-13 01:16:02
<! - 我是不是實現了jQuery權? - ><!DOCTYPE HTML> \t \t
\t \t