下面提供的是我的 html 和 css 代码的片段,我不仅需要在 html 和 css 中添加,而且还需要在 javascript 中添加什么,才能使其以滑入/滑出的方式工作(向右打开)和(左关闭)div?
<div id="left">
<a href="#">Edit Profile</a>
<a href="#">Settings</a>
<a href="?logoff">Sign Out</a>
</div>
#left { width: 338px; border-left: 1px solid #333; float: left; }
#left a {
width: 145px;
height: 22px;
padding: 5px 12px;
margin: 0;
border-bottom: 1px solid rgba(204, 204, 204, 0.09);
float: left;
display: inline-block;
position: relative;
top: 34px;
color: #15ADFF;
font: 16px Arial, Helvetica, sans-serif;
font-weight: bold;
font-variant: small-caps;
text-shadow: -1px -1px 1px #000, 2px 2px 3px rgba(110, 110, 110, 0.7);
}
#left a:hover {
width: 138px;
background: rgba(204, 204, 204, 0.4);
border-right: 7px solid #15ADFF;
color: #111;
text-shadow: 2px 2px 3px rgba(255, 255, 255, 0.4);
}
我目前没有为此编写任何 JavaScript,因为我不知道从哪里开始......但是,我正在使用 jquery-1.3.2
编辑:如果有人可以提供 jsfiddle,我将非常感激;)