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

· 16년 전 · 1641
<!---- 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,568
16년 전 조회 2,231
16년 전 조회 2,080
16년 전 조회 2,808
16년 전 조회 2,418
16년 전 조회 1,553
16년 전 조회 4,592
16년 전 조회 1,679
16년 전 조회 1,979
16년 전 조회 2,404
16년 전 조회 4,065
16년 전 조회 2,954
16년 전 조회 1,678
16년 전 조회 4,248
16년 전 조회 1,586
16년 전 조회 1,765
16년 전 조회 1,440
16년 전 조회 1,905
16년 전 조회 1,815
16년 전 조회 1,820
16년 전 조회 1,607
16년 전 조회 2,365
16년 전 조회 1,990
16년 전 조회 2,164
16년 전 조회 2,384
16년 전 조회 1,661
16년 전 조회 2,536
16년 전 조회 2,427
16년 전 조회 4,717
16년 전 조회 1,504
16년 전 조회 1,236
16년 전 조회 2,185
16년 전 조회 2,163
16년 전 조회 1,710
16년 전 조회 2,273
16년 전 조회 2,478
16년 전 조회 1,582
16년 전 조회 1,932
16년 전 조회 2,115
16년 전 조회 1,191
16년 전 조회 1,905
16년 전 조회 1,589
16년 전 조회 2,086
16년 전 조회 1,503
16년 전 조회 2,406
16년 전 조회 2,083
16년 전 조회 6,093
16년 전 조회 2,100
16년 전 조회 3,878
16년 전 조회 1,642
16년 전 조회 1,933
16년 전 조회 2,278
16년 전 조회 2,805
16년 전 조회 2,504
16년 전 조회 2,940
16년 전 조회 3,185
16년 전 조회 3,199
16년 전 조회 1,993
16년 전 조회 1,718
17년 전 조회 1,581
17년 전 조회 1,919
17년 전 조회 1,402
17년 전 조회 2,153
17년 전 조회 1,926
17년 전 조회 1,786
17년 전 조회 1,485
17년 전 조회 2,368
17년 전 조회 3,427
17년 전 조회 2,326
17년 전 조회 1,926
17년 전 조회 1,705
17년 전 조회 2,229
17년 전 조회 4,911
17년 전 조회 1,636
17년 전 조회 2,365
17년 전 조회 2,329
17년 전 조회 2,610
17년 전 조회 2,327
17년 전 조회 4,649
17년 전 조회 3,141
17년 전 조회 3,057
17년 전 조회 1,773
17년 전 조회 1,421
17년 전 조회 4,154
17년 전 조회 1,832
17년 전 조회 1,820
17년 전 조회 2,306
17년 전 조회 2,063
17년 전 조회 1,702
17년 전 조회 4,118
17년 전 조회 1,948
17년 전 조회 3,296
17년 전 조회 3,221
17년 전 조회 1,203
17년 전 조회 2,036
17년 전 조회 1,785
17년 전 조회 2,025
17년 전 조회 2,851
17년 전 조회 3,208
17년 전 조회 3,423