私はjsfiddleでこのコードを持っています
簡単に言えば、固定サイズのページ(1920x1080)で下から引き出したいのですが、このサンプルを右端から引っ張るように機能させていますが、下に移動する方法がわかりません。
あなたが助けることができれば、どうもありがとう
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;
}