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

· 17년 전 · 1884
<!---- 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,831
16년 전 조회 2,506
16년 전 조회 2,343
16년 전 조회 3,059
16년 전 조회 2,667
16년 전 조회 1,811
16년 전 조회 4,851
16년 전 조회 1,932
16년 전 조회 2,241
16년 전 조회 2,677
16년 전 조회 4,324
16년 전 조회 3,223
16년 전 조회 1,941
16년 전 조회 4,483
16년 전 조회 1,839
16년 전 조회 2,024
16년 전 조회 1,697
16년 전 조회 2,164
16년 전 조회 2,089
16년 전 조회 2,072
16년 전 조회 1,857
16년 전 조회 2,617
16년 전 조회 2,251
16년 전 조회 2,412
16년 전 조회 2,640
16년 전 조회 1,905
16년 전 조회 2,793
16년 전 조회 2,682
16년 전 조회 4,981
16년 전 조회 1,763
16년 전 조회 1,505
16년 전 조회 2,460
16년 전 조회 2,407
16년 전 조회 1,974
16년 전 조회 2,518
16년 전 조회 2,723
16년 전 조회 1,825
16년 전 조회 2,197
16년 전 조회 2,375
16년 전 조회 1,462
16년 전 조회 2,161
16년 전 조회 1,847
16년 전 조회 2,347
16년 전 조회 1,744
16년 전 조회 2,646
16년 전 조회 2,340
16년 전 조회 6,327
17년 전 조회 2,351
17년 전 조회 4,114
17년 전 조회 1,885
17년 전 조회 2,183
17년 전 조회 2,525
17년 전 조회 3,047
17년 전 조회 2,739
17년 전 조회 3,181
17년 전 조회 3,427
17년 전 조회 3,442
17년 전 조회 2,254
17년 전 조회 1,976
17년 전 조회 1,846
17년 전 조회 2,166
17년 전 조회 1,644
17년 전 조회 2,402
17년 전 조회 2,182
17년 전 조회 2,026
17년 전 조회 1,728
17년 전 조회 2,596
17년 전 조회 3,671
17년 전 조회 2,556
17년 전 조회 2,173
17년 전 조회 1,936
17년 전 조회 2,478
17년 전 조회 5,160
17년 전 조회 1,860
17년 전 조회 2,603
17년 전 조회 2,573
17년 전 조회 2,851
17년 전 조회 2,566
17년 전 조회 4,896
17년 전 조회 3,396
17년 전 조회 3,305
17년 전 조회 2,021
17년 전 조회 1,684
17년 전 조회 4,413
17년 전 조회 2,080
17년 전 조회 2,081
17년 전 조회 2,572
17년 전 조회 2,317
17년 전 조회 1,954
17년 전 조회 4,367
17년 전 조회 2,185
17년 전 조회 3,543
17년 전 조회 3,457
17년 전 조회 1,459
17년 전 조회 2,238
17년 전 조회 2,020
17년 전 조회 2,270
17년 전 조회 3,078
17년 전 조회 3,431
17년 전 조회 3,640