很簡單的代碼拉出一個div,我希望把它拉出來的底部,有一個固定大小的頁面(1920×1080),我有這個樣的工作,從拉右邊緣,但不知道如何將其移動到底部。
非常感謝,如果你能幫助
HTML
<div id="slideout">
<div id="slidecontent">
Yar, there be dragonns herre!
</div>
<div id="clickme">
</div>
</div>
腳本
$(function() {
$("#clickme").toggle(function() {
$(this).parent().animate({right:'0px'}, {queue: false, duration: 500});
}, function() {
$(this).parent().animate({right:'-280px'}, {queue: false, duration: 500});
});
});
風格:
body {
overflow-x: hidden;
}
#slideout {
background: #666;
position: absolute;
width: 280px;
height: 80px;
top: 45%;
right:-280px;
padding-left: 20px
}
#clickme {
position: absolute;
top: 0; left: 0;
height: 20px;
width: 20px;
background: #ff0000;
}
#slidecontent {
float:left;
}