次のように、ページの右側に固定 div があります。
これは私のhtmlです:
<a id="toggle" class="open"><img src="_styles/images/open_close.png" alt="openclose" /></a>
<div class="tweetdetails" style="width: 0px;">
<p class="screenname">@BachelorGDM</p><br>
<img src="linktoimage" alt="image_user"><br>
<p class="createdon">Created on: Mar 8, 2013</p><br>
<hr>
<p class="text">Here is some text</p>
</div>
これは私のCSSです:
.tweetdetails{
color:white;
padding:10px 50px;
position: fixed;
right:0px;
width:300px;
z-index: 999;
background-color: #FFF;
height:100%;
background-color: black;
border-left: 5px solid rgb(127,255,255);
}
.open{
background-repeat: no-repeat;
background-size: 50px auto;
color:red;
position: fixed;
right:400px;
top:50%;
}
私のJavascriptには次のものがあります:
$("#toggle").click(function(){
$(".tweetdetails").animate({width:'0px'}, 500);
$("#toggle").animate({right: "-=300"}, 500);
})
しかし、私はいつもこのような結果を持っています:
もう何も表示されないようにするにはどうすればよいですか? (パディングと関係があると思います...)