항상 같은곳에 광고창 만들기

· 16년 전 · 1648
<!---- 1. 아래의 코드를 HEAD 부분에 붙여 넣으세요 ------>

<style>
<!--
.drag{position:relative;cursor:hand
}
#scontentmain{
position:absolute;
width:150px;
}
#scontentbar{
cursor:hand;
position:absolute;
background-color:green;
height:15;
width:100%;
top:0;
}
#scontentsub{
position:absolute;
width:100%;
top:15;
background-color:lightyellow;
border:2px solid green;
padding:1.5px;
}
-->
</style>

<script language="JavaScript1.2">
<!--

var dragapproved=false
var zcor,xcor,ycor

function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function movescontentmain(){
if (event.button==1&&dragapproved){
zcor.style.pixelLeft=tempvar1+event.clientX-xcor
zcor.style.pixelTop=tempvar2+event.clientY-ycor
leftpos=document.all.scontentmain.style.pixelLeft-ietruebody().scrollLeft
toppos=document.all.scontentmain.style.pixelTop-ietruebody().scrollTop
return false
}
}
function dragscontentmain(){
if (!document.all)
return
if (event.srcElement.id=="scontentbar"){
dragapproved=true
zcor=scontentmain
tempvar1=zcor.style.pixelLeft
tempvar2=zcor.style.pixelTop
xcor=event.clientX
ycor=event.clientY
document.onmousemove=movescontentmain
}
}
document.onmousedown=dragscontentmain
document.onmouseup=new Function("dragapproved=false")
//-->
</script>

</HEAD>

<BODY>

<!--- 아래의 코드를 </body> 태그위에 붙여넣으세요 --------->

<div id="scontentmain">
        <div id="scontentbar" >
        <a href="javascript:onoffdisplay()">축소</a>
        </div>
                <div id="scontentsub">
                <p align="center"><br>
                광고창</p>
                여기에 내용을 입력 하세요
                </div>
        </div>
</div>

<script language="JavaScript1.2">

var w=ietruebody().clientWidth-195 // 화면 오른쪽 끝에서 -195 px
var h=50 // 화면 위에서 50px

w+=ietruebody().scrollLeft
h+=ietruebody().scrollTop

var leftpos=w
var toppos=h
scontentmain.style.left=w
scontentmain.style.top=h

function onoffdisplay(){
if (scontentsub.style.display=='')
scontentsub.style.display='none'
else
scontentsub.style.display=''
}

function staticize(){
w2=ietruebody().scrollLeft+leftpos
h2=ietruebody().scrollTop+toppos
scontentmain.style.left=w2
scontentmain.style.top=h2
}
window.onscroll=staticize

</script>

[이 게시물은 관리자님에 의해 2011-10-31 16:57:14 JavaScript에서 이동 됨]
|
댓글을 작성하시려면 로그인이 필요합니다.

프로그램

+
제목 글쓴이 날짜 조회
16년 전 조회 1,576
16년 전 조회 2,241
16년 전 조회 2,091
16년 전 조회 2,821
16년 전 조회 2,428
16년 전 조회 1,559
16년 전 조회 4,605
16년 전 조회 1,686
16년 전 조회 1,989
16년 전 조회 2,408
16년 전 조회 4,081
16년 전 조회 2,964
16년 전 조회 1,685
16년 전 조회 4,259
16년 전 조회 1,595
16년 전 조회 1,772
16년 전 조회 1,448
16년 전 조회 1,915
16년 전 조회 1,827
16년 전 조회 1,826
16년 전 조회 1,613
16년 전 조회 2,373
16년 전 조회 2,002
16년 전 조회 2,173
16년 전 조회 2,395
16년 전 조회 1,668
16년 전 조회 2,546
16년 전 조회 2,437
16년 전 조회 4,734
16년 전 조회 1,506
16년 전 조회 1,246
16년 전 조회 2,201
16년 전 조회 2,171
16년 전 조회 1,717
16년 전 조회 2,280
16년 전 조회 2,485
16년 전 조회 1,592
16년 전 조회 1,944
16년 전 조회 2,122
16년 전 조회 1,206
16년 전 조회 1,917
16년 전 조회 1,597
16년 전 조회 2,096
16년 전 조회 1,513
16년 전 조회 2,425
16년 전 조회 2,090
16년 전 조회 6,107
16년 전 조회 2,105
16년 전 조회 3,888
16년 전 조회 1,649
16년 전 조회 1,942
16년 전 조회 2,283
16년 전 조회 2,811
16년 전 조회 2,513
16년 전 조회 2,949
16년 전 조회 3,191
16년 전 조회 3,206
16년 전 조회 1,998
17년 전 조회 1,727
17년 전 조회 1,594
17년 전 조회 1,926
17년 전 조회 1,410
17년 전 조회 2,160
17년 전 조회 1,934
17년 전 조회 1,791
17년 전 조회 1,495
17년 전 조회 2,372
17년 전 조회 3,432
17년 전 조회 2,334
17년 전 조회 1,935
17년 전 조회 1,716
17년 전 조회 2,238
17년 전 조회 4,922
17년 전 조회 1,647
17년 전 조회 2,376
17년 전 조회 2,337
17년 전 조회 2,616
17년 전 조회 2,338
17년 전 조회 4,653
17년 전 조회 3,151
17년 전 조회 3,067
17년 전 조회 1,777
17년 전 조회 1,430
17년 전 조회 4,161
17년 전 조회 1,837
17년 전 조회 1,832
17년 전 조회 2,312
17년 전 조회 2,079
17년 전 조회 1,708
17년 전 조회 4,126
17년 전 조회 1,957
17년 전 조회 3,301
17년 전 조회 3,224
17년 전 조회 1,215
17년 전 조회 2,038
17년 전 조회 1,793
17년 전 조회 2,033
17년 전 조회 2,858
17년 전 조회 3,216
17년 전 조회 3,430