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

· 17년 전 · 1902
<!---- 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,870
16년 전 조회 2,543
16년 전 조회 2,377
16년 전 조회 3,083
16년 전 조회 2,696
16년 전 조회 1,843
16년 전 조회 4,887
16년 전 조회 1,975
16년 전 조회 2,284
16년 전 조회 2,710
16년 전 조회 4,358
16년 전 조회 3,254
16년 전 조회 1,972
16년 전 조회 4,512
16년 전 조회 1,874
16년 전 조회 2,057
16년 전 조회 1,723
16년 전 조회 2,198
16년 전 조회 2,122
16년 전 조회 2,113
16년 전 조회 1,889
16년 전 조회 2,655
16년 전 조회 2,283
16년 전 조회 2,444
16년 전 조회 2,676
16년 전 조회 1,939
16년 전 조회 2,829
16년 전 조회 2,717
16년 전 조회 5,013
16년 전 조회 1,807
16년 전 조회 1,545
16년 전 조회 2,487
16년 전 조회 2,443
16년 전 조회 2,016
16년 전 조회 2,557
16년 전 조회 2,749
16년 전 조회 1,856
16년 전 조회 2,239
16년 전 조회 2,412
16년 전 조회 1,491
16년 전 조회 2,202
16년 전 조회 1,882
16년 전 조회 2,383
16년 전 조회 1,780
16년 전 조회 2,679
16년 전 조회 2,377
16년 전 조회 6,359
17년 전 조회 2,380
17년 전 조회 4,140
17년 전 조회 1,903
17년 전 조회 2,205
17년 전 조회 2,555
17년 전 조회 3,076
17년 전 조회 2,772
17년 전 조회 3,203
17년 전 조회 3,447
17년 전 조회 3,477
17년 전 조회 2,281
17년 전 조회 1,990
17년 전 조회 1,872
17년 전 조회 2,194
17년 전 조회 1,669
17년 전 조회 2,425
17년 전 조회 2,203
17년 전 조회 2,046
17년 전 조회 1,743
17년 전 조회 2,622
17년 전 조회 3,699
17년 전 조회 2,580
17년 전 조회 2,198
17년 전 조회 1,962
17년 전 조회 2,493
17년 전 조회 5,190
17년 전 조회 1,890
17년 전 조회 2,631
17년 전 조회 2,593
17년 전 조회 2,872
17년 전 조회 2,588
17년 전 조회 4,922
17년 전 조회 3,416
17년 전 조회 3,323
17년 전 조회 2,043
17년 전 조회 1,709
17년 전 조회 4,436
17년 전 조회 2,099
17년 전 조회 2,103
17년 전 조회 2,592
17년 전 조회 2,340
17년 전 조회 1,973
17년 전 조회 4,383
17년 전 조회 2,207
17년 전 조회 3,566
17년 전 조회 3,486
17년 전 조회 1,480
17년 전 조회 2,258
17년 전 조회 2,039
17년 전 조회 2,289
17년 전 조회 3,096
17년 전 조회 3,452
17년 전 조회 3,662