레이어 드래그앤 드롭 > script

본문 바로가기
사이트 내 전체검색

script

레이어 드래그앤 드롭

페이지 정보

작성자 서방님 댓글 0건 조회 355회 작성일 07-04-25 13:18

본문

<script language="JavaScript">
var x  =0;
var y =0;
drag  = 0;
move  = 0;
window.document.onmousemove = mouseMove
window.document.onmousedown = mouseDown
window.document.onmouseup = mouseUp
window.document.ondragstart = mouseStop
function mouseUp() {
move = 0
}
function mouseDown() {
if (drag) {
clickleft = window.event.x - parseInt(dragObj.style.left)
clicktop = window.event.y - parseInt(dragObj.style.top)
dragObj.style.zIndex += 1
move = 1
}
}
function mouseMove() {
if (move) {
dragObj.style.left = window.event.x - clickleft
dragObj.style.top = window.event.y - clicktop
}
}
function mouseStop() {
window.event.returnValue = false
}
function Show(divid) {
divid.filters.blendTrans.apply();
divid.style.visibility = "visible";
divid.filters.blendTrans.play();
}
function Hide(divid) {
divid.filters.blendTrans.apply();
divid.style.visibility = "hidden";
divid.filters.blendTrans.play();
}
</script>

이것과

<div 태그 이벤트 핸들러에

onmouseover="dragObj=[div 아이디] ; drag=1;move=0"

onmouseout="drag=0"

만 추가하면 간단히 드래그앤 드롭 레이어 구현!!

댓글목록

등록된 댓글이 없습니다.

Total 846건 43 페이지
script 목록
번호 제목 글쓴이 조회 날짜
216 서방님 454 07-06
215 서방님 531 06-27
214 서방님 455 06-27
213 서방님 586 06-27
212 서방님 405 06-27
211 서방님 569 06-22
210 서방님 441 06-22
209 서방님 198 06-11
208 서방님 324 06-11
207 서방님 293 05-30
206 서방님 564 04-26
205 서방님 343 04-25
204 서방님 415 04-25
203 서방님 272 04-25
열람중 서방님 356 04-25
게시물 검색

회원로그인

접속자집계

오늘
459
어제
1,871
최대
2,993
전체
261,195
Latest Crypto Fear & Greed Index

그누보드5
Copyright © 서방님.kr All rights reserved.