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

· 16년 전 · 1713
<!---- 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,651
16년 전 조회 2,308
16년 전 조회 2,154
16년 전 조회 2,882
16년 전 조회 2,490
16년 전 조회 1,621
16년 전 조회 4,669
16년 전 조회 1,756
16년 전 조회 2,056
16년 전 조회 2,469
16년 전 조회 4,151
16년 전 조회 3,044
16년 전 조회 1,752
16년 전 조회 4,320
16년 전 조회 1,664
16년 전 조회 1,839
16년 전 조회 1,516
16년 전 조회 1,976
16년 전 조회 1,889
16년 전 조회 1,897
16년 전 조회 1,684
16년 전 조회 2,442
16년 전 조회 2,053
16년 전 조회 2,237
16년 전 조회 2,458
16년 전 조회 1,732
16년 전 조회 2,614
16년 전 조회 2,506
16년 전 조회 4,799
16년 전 조회 1,578
16년 전 조회 1,313
16년 전 조회 2,273
16년 전 조회 2,235
16년 전 조회 1,786
16년 전 조회 2,350
16년 전 조회 2,559
16년 전 조회 1,650
16년 전 조회 2,013
16년 전 조회 2,190
16년 전 조회 1,283
16년 전 조회 1,982
16년 전 조회 1,667
16년 전 조회 2,165
16년 전 조회 1,583
16년 전 조회 2,477
16년 전 조회 2,151
16년 전 조회 6,170
16년 전 조회 2,172
16년 전 조회 3,957
16년 전 조회 1,714
16년 전 조회 2,006
16년 전 조회 2,352
16년 전 조회 2,880
16년 전 조회 2,573
17년 전 조회 3,012
17년 전 조회 3,251
17년 전 조회 3,272
17년 전 조회 2,072
17년 전 조회 1,792
17년 전 조회 1,663
17년 전 조회 1,991
17년 전 조회 1,472
17년 전 조회 2,222
17년 전 조회 1,997
17년 전 조회 1,852
17년 전 조회 1,553
17년 전 조회 2,434
17년 전 조회 3,493
17년 전 조회 2,400
17년 전 조회 1,995
17년 전 조회 1,780
17년 전 조회 2,299
17년 전 조회 4,983
17년 전 조회 1,698
17년 전 조회 2,437
17년 전 조회 2,400
17년 전 조회 2,669
17년 전 조회 2,389
17년 전 조회 4,711
17년 전 조회 3,209
17년 전 조회 3,126
17년 전 조회 1,838
17년 전 조회 1,498
17년 전 조회 4,227
17년 전 조회 1,899
17년 전 조회 1,899
17년 전 조회 2,375
17년 전 조회 2,143
17년 전 조회 1,780
17년 전 조회 4,196
17년 전 조회 2,022
17년 전 조회 3,362
17년 전 조회 3,286
17년 전 조회 1,281
17년 전 조회 2,093
17년 전 조회 1,851
17년 전 조회 2,112
17년 전 조회 2,914
17년 전 조회 3,278
17년 전 조회 3,482