<script language='javascript'>
<!--
var sd;
var hi = 30;
var min = 30;
var max = 150;
window.onload = function()
{
sd = document.getElementById('slide');
sd.style.top = document.body.clientHeight - hi;
}
function fncHeight(obj)
{
return document.body.clientHeight;
}
var up;
var dn;
function fncUp()
{
clearTimeout(dn);
var obj = document.getElementById('btn');
obj.onclick = fncDown;
if(hi<max)
{
hi += 5;
sd.style.top = document.body.clientHeight - hi;
sd.style.height = hi;
up = setTimeout(fncUp,10);
}
else
{
obj.innerHTML = '▼';
}
}
function fncDown()
{
clearTimeout(up);
var obj = document.getElementById('btn');
obj.onclick = fncUp;
if(hi>min)
{
hi -= 5;
sd.style.top = document.body.clientHeight - hi;
sd.style.height = hi;
dn = setTimeout(fncDown,10);
}
else
{
obj.innerHTML = '▲';
}
}
//-->
</script>
<div id='slide' style='position:absolute; background-color:red; top:100px; left:0px; width:100%; height:30; text-align:center;'>
<span id='btn' style='cursor:hand;' onclick='fncUp();'>test</span>
</div>
'프로그래밍 > Javascript' 카테고리의 다른 글
모바일 웹 접속시 최적화 (0) | 2012.06.20 |
---|---|
스마트폰 사이트 접속시 모바일웹 redirect 기법 (0) | 2012.06.20 |
입력제한 (0) | 2012.04.12 |
ime-mode (0) | 2012.04.12 |
텍스트 박스 클릭하면 글씨 사라지고 빈값 체크 (0) | 2012.04.10 |