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

· 17년 전 · 1859
<!---- 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,796
16년 전 조회 2,466
16년 전 조회 2,311
16년 전 조회 3,022
16년 전 조회 2,634
16년 전 조회 1,775
16년 전 조회 4,814
16년 전 조회 1,894
16년 전 조회 2,204
16년 전 조회 2,634
16년 전 조회 4,284
16년 전 조회 3,188
16년 전 조회 1,904
16년 전 조회 4,451
16년 전 조회 1,803
16년 전 조회 1,993
16년 전 조회 1,661
16년 전 조회 2,137
16년 전 조회 2,054
16년 전 조회 2,043
16년 전 조회 1,821
16년 전 조회 2,584
16년 전 조회 2,224
16년 전 조회 2,383
16년 전 조회 2,610
16년 전 조회 1,873
16년 전 조회 2,757
16년 전 조회 2,643
16년 전 조회 4,947
16년 전 조회 1,721
16년 전 조회 1,469
16년 전 조회 2,423
16년 전 조회 2,379
16년 전 조회 1,934
16년 전 조회 2,484
16년 전 조회 2,687
16년 전 조회 1,800
16년 전 조회 2,158
16년 전 조회 2,337
16년 전 조회 1,419
16년 전 조회 2,132
16년 전 조회 1,819
16년 전 조회 2,320
16년 전 조회 1,717
16년 전 조회 2,616
16년 전 조회 2,310
16년 전 조회 6,305
16년 전 조회 2,325
17년 전 조회 4,090
17년 전 조회 1,860
17년 전 조회 2,157
17년 전 조회 2,500
17년 전 조회 3,015
17년 전 조회 2,708
17년 전 조회 3,160
17년 전 조회 3,401
17년 전 조회 3,415
17년 전 조회 2,227
17년 전 조회 1,950
17년 전 조회 1,819
17년 전 조회 2,132
17년 전 조회 1,616
17년 전 조회 2,368
17년 전 조회 2,153
17년 전 조회 1,994
17년 전 조회 1,692
17년 전 조회 2,561
17년 전 조회 3,637
17년 전 조회 2,531
17년 전 조회 2,142
17년 전 조회 1,905
17년 전 조회 2,443
17년 전 조회 5,129
17년 전 조회 1,824
17년 전 조회 2,570
17년 전 조회 2,533
17년 전 조회 2,816
17년 전 조회 2,525
17년 전 조회 4,858
17년 전 조회 3,364
17년 전 조회 3,272
17년 전 조회 1,989
17년 전 조회 1,656
17년 전 조회 4,375
17년 전 조회 2,045
17년 전 조회 2,041
17년 전 조회 2,530
17년 전 조회 2,277
17년 전 조회 1,913
17년 전 조회 4,332
17년 전 조회 2,153
17년 전 조회 3,506
17년 전 조회 3,429
17년 전 조회 1,423
17년 전 조회 2,196
17년 전 조회 1,975
17년 전 조회 2,226
17년 전 조회 3,039
17년 전 조회 3,387
17년 전 조회 3,597