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

· 16년 전 · 1459
<!---- 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,366
16년 전 조회 2,027
16년 전 조회 1,875
16년 전 조회 2,552
16년 전 조회 2,224
16년 전 조회 1,355
16년 전 조회 4,376
16년 전 조회 1,468
16년 전 조회 1,775
16년 전 조회 2,196
16년 전 조회 3,828
16년 전 조회 2,725
16년 전 조회 1,483
16년 전 조회 4,005
16년 전 조회 1,388
16년 전 조회 1,572
16년 전 조회 1,236
16년 전 조회 1,711
16년 전 조회 1,606
16년 전 조회 1,624
16년 전 조회 1,415
16년 전 조회 2,168
16년 전 조회 1,810
16년 전 조회 1,963
16년 전 조회 2,175
16년 전 조회 1,461
16년 전 조회 2,296
16년 전 조회 2,246
16년 전 조회 4,524
16년 전 조회 1,285
16년 전 조회 1,041
16년 전 조회 2,000
16년 전 조회 1,969
16년 전 조회 1,502
16년 전 조회 2,029
16년 전 조회 2,264
16년 전 조회 1,383
16년 전 조회 1,722
16년 전 조회 1,911
16년 전 조회 997
16년 전 조회 1,682
16년 전 조회 1,399
16년 전 조회 1,900
16년 전 조회 1,314
16년 전 조회 2,198
16년 전 조회 1,882
16년 전 조회 5,862
16년 전 조회 1,907
16년 전 조회 3,676
16년 전 조회 1,460
16년 전 조회 1,748
16년 전 조회 2,062
16년 전 조회 2,601
16년 전 조회 2,301
16년 전 조회 2,744
16년 전 조회 2,981
16년 전 조회 3,008
16년 전 조회 1,813
16년 전 조회 1,531
16년 전 조회 1,405
16년 전 조회 1,716
16년 전 조회 1,200
16년 전 조회 1,957
16년 전 조회 1,727
16년 전 조회 1,603
16년 전 조회 1,288
16년 전 조회 2,164
16년 전 조회 3,224
16년 전 조회 2,158
16년 전 조회 1,735
16년 전 조회 1,500
16년 전 조회 2,034
16년 전 조회 4,722
16년 전 조회 1,406
16년 전 조회 2,141
16년 전 조회 2,123
17년 전 조회 2,392
17년 전 조회 2,139
17년 전 조회 4,426
17년 전 조회 2,923
17년 전 조회 2,858
17년 전 조회 1,593
17년 전 조회 1,231
17년 전 조회 3,935
17년 전 조회 1,609
17년 전 조회 1,601
17년 전 조회 2,100
17년 전 조회 1,872
17년 전 조회 1,489
17년 전 조회 3,911
17년 전 조회 1,747
17년 전 조회 3,120
17년 전 조회 3,001
17년 전 조회 1,032
17년 전 조회 1,842
17년 전 조회 1,583
17년 전 조회 1,844
17년 전 조회 2,634
17년 전 조회 3,018
17년 전 조회 3,211
🐛 버그신고