레이어 스부적스부적 이동 스크립트

· 17년 전 · 1300
<script> /* // // 레이어 스부적스부적 이동 스크립트. // // by hanulis(hanulis@gmail.com). 2007. // // usage: mino.layer.moveSmooth(obj,x,y); // // 설명: obj를 x,y 위치로 스부적 이동시킴. obj의 style중 position:absolute가 추가되어있어야 합니다. // // 예제: <div id="test" style="position:absolute">aaa</div> // <script>mino.layer.moveSmooth(document.getElementById("test"),200,400); </ script> // // 보너스: x혹은 y축만 움직이고 싶을때, 움직이지 않을축을 null로 지정합니다. // // 예제: <script>mino.layer.moveSmooth(document.getElementById("test"),null,400); </ script> // */ var mino={} var _mino_layer_smooth_obj=null; var _mino_layer_smooth_doing=false; mino.layer={ xy:function(obj) { if(document.getBoxObjectFor) { //firefox try { var tempXY=document.getBoxObjectFor(obj); } catch(e) {return [0,0,obj.offsetWidth,obj.offsetHeight]} return [tempXY.x,tempXY.y,obj.offsetWidth,obj.offsetHeight]; } else if(obj.getBoundingClientRect) { //internet Explorer var tempXY=obj.getBoundingClientRect(); return [(tempXY.left+document.body.scrollLeft),(tempXY.top+document.body.scrollTop),obj.offsetWidth,obj.offsetHeight]; } else return false; }, moveSmooth:function(obj,x,y) { if(!_mino_layer_smooth_obj) _mino_layer_smooth_obj=obj; if(arguments[3]==undefined && _mino_layer_smooth_doing) { return; } else _mino_layer_smooth_doing=1; var loc=mino.layer.xy(_mino_layer_smooth_obj); if(x!=null) { if(Math.abs(Math.abs(loc[0])-Math.abs(x))<10) { obj.style.left=x; var xc=1; } else { obj.style.left=parseInt(loc[0]+(x-loc[0])/3); } } else var xc=1; if(y!=null) { if(Math.abs(Math.abs(loc[1])-Math.abs(y))<10) { obj.style.top=y; var yc=1; } else { obj.style.top=parseInt(loc[1]+(y-loc[1])/3); } } else var yc=1; if(xc && yc) { _mino_layer_smooth_doing=0; _mino_layer_smooth_obj=null; return; } setTimeout('mino.layer.moveSmooth(_mino_layer_smooth_obj,'+x+','+y+',"s")',10); } } </script> <div id="k" style="background-color:#eeffe0;position:absolute;width:200;height:200;border:1px solid #000000"></div> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <input type=button value="move(0,0)" onclick="mino.layer.moveSmooth(document.getElementById('k'),0,0)"> <input type=button value="move(-200,-200)" onclick="mino.layer.moveSmooth(document.getElementById('k'),-200,-200)"> <input type=button value="move(400,400)" onclick="mino.layer.moveSmooth(document.getElementById('k'),400,400)"> <input type=button value="move(300,300)" onclick="mino.layer.moveSmooth(document.getElementById('k'),300,300)"> <input type=button value="move(500,null)" onclick="mino.layer.moveSmooth(document.getElementById('k'),500,null)"> <input type=button value="move(null,500)" onclick="mino.layer.moveSmooth(document.getElementById('k'),null,500)">
[이 게시물은 관리자님에 의해 2011-10-31 17:16:08 PHP & HTML에서 이동 됨]
|
댓글을 작성하시려면 로그인이 필요합니다.

프로그램

+
제목 글쓴이 날짜 조회
17년 전 조회 1,420
17년 전 조회 2,253
17년 전 조회 1,979
17년 전 조회 2,290
17년 전 조회 2,818
17년 전 조회 3,265
17년 전 조회 2,367
17년 전 조회 1,634
17년 전 조회 3,208
17년 전 조회 3,073
17년 전 조회 3,047
17년 전 조회 3,916
17년 전 조회 2,590
17년 전 조회 2,408
17년 전 조회 2,658
17년 전 조회 2,897
17년 전 조회 2,612
17년 전 조회 1,456
17년 전 조회 1,899
17년 전 조회 1,490
17년 전 조회 1,916
17년 전 조회 2,514
17년 전 조회 8,698
17년 전 조회 3,158
17년 전 조회 4,246
17년 전 조회 1,985
17년 전 조회 3,661
17년 전 조회 1,555
17년 전 조회 1,387
17년 전 조회 2,323
17년 전 조회 1,317
17년 전 조회 1,633
17년 전 조회 1,466
17년 전 조회 2,534
17년 전 조회 1,503
17년 전 조회 1,094
17년 전 조회 1,228
17년 전 조회 3,101
17년 전 조회 2,164
17년 전 조회 1,972
17년 전 조회 1,218
17년 전 조회 2,452
17년 전 조회 1,171
17년 전 조회 1,130
17년 전 조회 1,377
17년 전 조회 2,742
17년 전 조회 2,395
17년 전 조회 2,483
17년 전 조회 1,182
17년 전 조회 1,301
17년 전 조회 3,245
17년 전 조회 2,831
17년 전 조회 4,099
17년 전 조회 2,262
17년 전 조회 2,358
17년 전 조회 1,407
17년 전 조회 2,528
17년 전 조회 2,210
17년 전 조회 2,971
17년 전 조회 2,482
17년 전 조회 1,642
17년 전 조회 2,436
17년 전 조회 1,591
17년 전 조회 1,179
17년 전 조회 2,239
17년 전 조회 2,887
17년 전 조회 4,063
17년 전 조회 3,149
17년 전 조회 1,418
17년 전 조회 1,707
17년 전 조회 2,247
17년 전 조회 1,553
17년 전 조회 1,728
17년 전 조회 2,718
17년 전 조회 2,144
17년 전 조회 1,799
17년 전 조회 4,202
17년 전 조회 3,048
17년 전 조회 1,444
17년 전 조회 3,573
17년 전 조회 2,801
17년 전 조회 2,079
17년 전 조회 1,300
17년 전 조회 2,336
17년 전 조회 2,072
17년 전 조회 1,984
17년 전 조회 1,928
17년 전 조회 1,180
17년 전 조회 1,887
17년 전 조회 2,937
17년 전 조회 1,439
17년 전 조회 1,679
17년 전 조회 1,361
17년 전 조회 1,609
17년 전 조회 1,583
17년 전 조회 1,454
17년 전 조회 2,565
17년 전 조회 2,332
17년 전 조회 2,109
17년 전 조회 1,419
🐛 버그신고