출처 : http://tong.nate.com/cookjava/49336451
마우스 오른쪽 버튼금지 2가지 방법
방법 1.
---------------------------------------------
<body oncontextmenu="return false" onselectstart="return false" ondragstart="return false">
완전히 오른쪽마우스가 안되게 하는 방법
<body bgcolor="#FFFFFF" text="#000000" oncontextmenu="return false">
드래그는 더되고 복사같은 기능 못쓰게 하는방법
<BODY onselectstart="return false" ondragstart="return false">
드래그만 안되고 복사 된는 기능
방법 2.
------------------------------------------------------------
<SCRIPT LANGUAGE=JAVASCRIPT>
/*
오른쪽 클릭 경고 박스 없이 못하게 하기(익스플로러/넷스케이프 모두)
*/
// 오른쪽 버튼 클릭을 못하게 하는 부분
if (window.Event) // 넷스케이프에서만 대문자 E.
document.captureEvents(Event.MOUSEUP); // mouse up 이벤트를 잡음
function nocontextmenu() // IE4에서만 적용, 다른 브라우저는 무시
{
event.cancelBubble = true
event.returnValue = false;
return false;
}
function norightclick(e) // 다른 모든 브라우저에서 작동
{
if (window.Event) // 다시, IE 또는 NAV ?
{
if (e.which == 2 || e.which == 3)
return false;
}
else
if (event.button == 2 || event.button == 3)
{
event.cancelBubble = true
event.returnValue = false;
return false;
}
}
document.oncontextmenu = nocontextmenu; // IE5+ 용
document.onmousedown = norightclick; // 다른 브라우저 용
</SCRIPT>
마우스 오른쪽 메뉴 맘대로 만들기
DHTM 을 이용한 마우스 오른쪽의 메뉴 만들기..
<script language="JavaScript1.2">
<!--
var isie=0;
if(window.navigator.appName=="Microsoft Internet Explorer"&&window.navigator.appVersion.substring(window.navigator.appVersion.indexOf("MSIE")+5,window.navigator.appVersion.indexOf("MSIE")+8)>=5.5) {
isie=1;
}
else {
isie=0;
}
if(isie) {
var html="";
html+='<TABLE STYLE="border="0" WIDTH="140" HEIGHT="180" CELLPADDING="0" CELLSPACING="0"background="HTTP://F2SKY.KOR1.NET/mrneuback.gif">';
html+='<ST'+'YLE TYPE="text/css">\n';
html+='a:link {text-decoration:none;font-family:Arial;font-size:8pt;}\n';
html+='a:visited {text-decoration:none;font-family:Arial;font-size:8pt;}\n';
html+='td {font-size:8pt;}\n';
html+='</ST'+'YLE>\n';
html+='<SC'+'RIPT LANGUAGE="JavaScript">\n';
html+='\n<'+'!--\n';
html+='window.onerror=null;\n';
html+='/'+' -'+'->\n';
html+='</'+'SCRIPT>\n';
html+='<TR><TD STYLE="border:0pt solid #FFFFFF" ID="i0" ONMOUSEOVER="document.all.i0.style.background=\'#FFFFFF\';document.all.i0.style.border=\'0pt solid #737B92\';" ONMOUSEOUT="document.all.i0.style.background=\'\';document.all.i0.style.border=\'0pt solid #CCCCCC\';" ONCLICK="window.history.go(-1);"> <img SRC="HTTP://F2SKY.KOR1.NET/menuback.gif" WIDTH="12" HEIGHT="12" BORDER="0" HSPACE="0" VSPACE="0" ALIGN="absmiddle"> 앞페이지로이동</TD></TR>';
html+='<TR><TD STYLE="border:0pt solid #FFFFFF" ID="i1" ONMOUSEOVER="document.all.i1.style.background=\'#FFFFFF\';document.all.i1.style.border=\'0pt solid #737B92\';" ONMOUSEOUT="document.all.i1.style.background=\'\';document.all.i0.style.border=\'0pt solid #CCCCCC\';" ONCLICK="window.history.go(1);"> <img SRC="HTTP://F2SKY.KOR1.NET/menuforward.gif" WIDTH="12" HEIGHT="12" BORDER="0" HSPACE="0" VSPACE="0" ALIGN="absmiddle"> 뒷페이지로이동</TD></TR>';
html+='<TR><TD STYLE="border:0pt solid #FFFFFF" ID="i4" ONMOUSEOVER="document.all.i4.style.background=\'#FFFFFF\';document.all.i4.style.border=\'0pt solid #737B92\';" ONMOUSEOUT="document.all.i4.style.background=\'\';document.all.i0.style.border=\'0pt solid #CCCCCC\';" ONCLICK="window.parent.external.AddFavorite(window.top.location.href,window.top.document.title);"> <img SRC="HTTP://F2SKY.KOR1.NET/menufavorite.gif" WIDTH="12" HEIGHT="12" BORDER="0" HSPACE="0" VSPACE="0" ALIGN="absmiddle"> 즐겨찾기에등록...</TD></TR>';
html+='<TR><TD STYLE="border:0pt solid #FFFFFF" ID="i5" ONMOUSEOVER="document.all.i5.style.background=\'#FFFFFF\';document.all.i5.style.border=\'0pt solid #737B92\';" ONMOUSEOUT="document.all.i5.style.background=\'\';document.all.i0.style.border=\'0pt solid #CCCCCC\';" ONCLICK="window.parent.location=\'view-source:\'+window.parent.location.href;"> <img SRC="HTTP://F2SKY.KOR1.NET/menusource.gif" WIDTH="12" HEIGHT="12" BORDER="0" HSPACE="0" VSPACE="0" ALIGN="absmiddle"> 소스보기</TD></TR>';
html+='<TR><TD STYLE="border:0pt solid #FFFFFF" ID="i6" ONMOUSEOVER="document.all.i6.style.background=\'#FFFFFF\';document.all.i6.style.border=\'0pt solid #737B92\';" ONMOUSEOUT="document.all.i6.style.background=\'\';document.all.i0.style.border=\'0pt solid #CCCCCC\';" ONCLICK="window.print();"> <img SRC="HTTP://F2SKY.KOR1.NET/menuprint.gif" WIDTH="12" HEIGHT="12" BORDER="0" HSPACE="0" VSPACE="0" ALIGN="absmiddle"> 프린트하기</TD></TR>';
html+='<TR><TD STYLE="border:0pt solid #FFFFFF" ID="i7" ONMOUSEOVER="document.all.i7.style.background=\'#FFFFFF\';document.all.i7.style.border=\'0pt solid #737B92\';" ONMOUSEOUT="document.all.i7.style.background=\'\';document.all.i0.style.border=\'0pt solid #CCCCCC\';" ONCLICK="window.parent.location.href=window.parent.location.href;"> <img SRC="HTTP://F2SKY.KOR1.NET/menurefresh.gif" WIDTH="12" HEIGHT="12" BORDER="0" HSPACE="0" VSPACE="0" ALIGN="absmiddle"> 새로고침</TD></TR>';
html+='<TR><TD STYLE="border:0pt solid #FFFFFF" ID="i8" ONMOUSEOVER="document.all.i8.style.background=\'#FFFFFF\';document.all.i8.style.border=\'0pt solid #737B92\';" ONMOUSEOUT="document.all.i8.style.background=\'\';document.all.i0.style.border=\'0pt solid #CCCCCC\';" ONCLICK="if(window.parent.document.body.style.zoom!=0) window.parent.document.body.style.zoom*=1.6; else window.parent.document.body.style.zoom=1.6;"> <img SRC="HTTP://F2SKY.KOR1.NET/menuzoom.gif" WIDTH="12" HEIGHT="12" BORDER="0" HSPACE="0" VSPACE="0" ALIGN="absmiddle"> 확대해서보기</TD></TR>';
html+='<TR><TD STYLE="border:0pt solid #FFFFFF" ID="i9" ONMOUSEOVER="document.all.i9.style.background=\'#FFFFFF\';document.all.i9.style.border=\'0pt solid #737B92\';" ONMOUSEOUT="document.all.i9.style.background=\'\';document.all.i0.style.border=\'0pt solid #CCCCCC\';" ONCLICK="if(window.parent.document.body.style.zoom!=0) window.parent.document.body.style.zoom*=0.625; else window.parent.document.body.style.zoom=0.625;"> <img SRC="HTTP://F2SKY.KOR1.NET/menuzoom.gif" WIDTH="12" HEIGHT="12" BORDER="0" HSPACE="0" VSPACE="0" ALIGN="absmiddle"> 축소해서보기</TD></TR>';
html+='</TABLE>';
var oPopup = window.createPopup();
}
function dopopup(x,y) {
if(isie) {
var oPopupBody = oPopup.document.body;
oPopupBody.innerHTML = html;
oPopup.show(x, y, 140, 180, document.body);
}
}
function click(e) {
if(isie) {
if(document.all) {
if(event.button==2||event.button==3) {
dopopup(event.x-1,event.y-1);
}
}
}
}
if(isie) {
document.oncontextmenu = function() { dopopup(event.x,event.y);return false; }
document.onmousedown = click;
}
// -->
</script>
마우스 오른쪽을 눌러보세염
배경을 고정하는 방법
배경화면을 고정시켜 사이즈에 따라 배경화면의 위치가 바뀌는 것을 막는 방법입니다.
<BODY bgProperties=fixed bgColor=#ffffff leftMargin=0 background="http://iloverflash.co.kr/bg.gif" topMargin=0 marginwidth="0" marginheight="0">
특정IP차단시키는 소스
<script language="javascript">
var ip = '<!--#echo var="REMOTE_ADDR"-->'
if (ip == '차단할IP주소') {
alert("STOP! You are viewing this page from an IP address that is not allowed!");
alert("Why can't you guys just leave me alone?");
if (confirm("Do you want to leave peacefully? Or will I have to help you?"))
{location.href="http://iloveflash.co.kr" } else { ("OK you choose I don't care! Bye bye! Don't come back!"); {location.href="http://iloveflash.co.kr" }} }
</script>
페이지가 용량이 많을때 읽는 중이라는 메시지보여주는 소스
로딩소스
<body onload="hide()">
<script language=javascript>
<!--
n = document.layers
ie = document.all
function hide() {
if (ie || n) {
if (n) document.Load.visibility = "hidden"
else Load.style.visibility = "hidden"
}
}
if(ie || n) document.write('<div id=Load style=position:absolute;width:100%;height:100%;top:0;left:0;background-color:#ffffff;z-index:5 align=center>')
document.write('<table border=0 height=100%>')
document.write('<tr>')
document.write('<td align=center><font size=4 color=gray face=굴림체>페이지를 읽고 있는 중입니다 ..... Loading...</font></td>')
document.write('</tr>')
document.write('</table>')
document.write('</div>')
//-->
</script>
화면가득 눈송이가 내리게 하는 소스
눈송이의 크기, 모양, 갯수, 위치도 설정할수 있습니다
<!-- [1단계] 아래의 코드를 <body> 와 </body> 태그 사이에 붙여 넣으세요 -->
<script>
// 눈송이의 갯수 (30 - 40 개 이상은 권하지 않습니다)
var snowmax=20
// 눈송이의 색상을 설정 하세요(더 추가하실수 있습니다)
var snowcolor=new Array("#aaaacc","#ddddFF","#ccccDD")
// 눈송이(사실은 글자)의 글꼴을 설정 하세요
var snowtype=new Array("Arial Black","Arial Narrow","Times","Comic Sans MS")
// 눈송이 모양
var snowletter="★"; // 눈송이모양은 (*) 가 좋습니다
// 떨어지는 속도 (0.3 에서 2 까지 권장)
var sinkspeed=0.6
// 눈송이의 최대크기
var snowmaxsize=30
// 눈송이의 최소크기
var snowminsize=8
// 눈이 내릴 구역을 설정 하세요
// 1 전체화면,
// 2 왼쪽화면
// 3 가운데 부분
// 4 오른쪽 화면
var snowingzone=1
var snow=new Array()
var marginbottom
var marginright
var timer
var i_snow=0
var x_mv=new Array();
var crds=new Array();
var lftrght=new Array();
var browserinfos=navigator.userAgent
var ie5=document.all&&document.getElementById&&!browserinfos.match(/Opera/)
var ns6=document.getElementById&&!document.all
var opera=browserinfos.match(/Opera/)
var browserok=ie5||ns6||opera
function randommaker(range) {
rand=Math.floor(range*Math.random())
return rand
}
function initsnow() {
if (ie5 || opera) {
marginbottom = document.body.clientHeight
marginright = document.body.clientWidth
}
else if (ns6) {
marginbottom = window.innerHeight
marginright = window.innerWidth
}
var snowsizerange=snowmaxsize-snowminsize
for (i=0;i<=snowmax;i++) {
crds[i] = 0;
lftrght[i] = Math.random()*15;
x_mv[i] = 0.03 + Math.random()/10;
snow[i]=document.getElementById("s"+i)
snow[i].style.fontFamily=snowtype[randommaker(snowtype.length)]
snow[i].size=randommaker(snowsizerange)+snowminsize
snow[i].style.fontSize=snow[i].size
snow[i].style.color=snowcolor[randommaker(snowcolor.length)]
snow[i].sink=sinkspeed*snow[i].size/5
if (snowingzone==1) {snow[i].posx=randommaker(marginright-snow[i].size)}
if (snowingzone==2) {snow[i].posx=randommaker(marginright/2-snow[i].size)}
if (snowingzone==3) {snow[i].posx=randommaker(marginright/2-snow[i].size)+marginright/4}
if (snowingzone==4) {snow[i].posx=randommaker(marginright/2-snow[i].size)+marginright/2}
snow[i].posy=randommaker(2*marginbottom-marginbottom-2*snow[i].size)
snow[i].style.left=snow[i].posx
snow[i].style.top=snow[i].posy
}
movesnow()
}
function movesnow() {
for (i=0;i<=snowmax;i++) {
crds[i] += x_mv[i];
snow[i].posy+=snow[i].sink
snow[i].style.left=snow[i].posx+lftrght[i]*Math.sin(crds[i]);
snow[i].style.top=snow[i].posy
if (snow[i].posy>=marginbottom-2*snow[i].size || parseInt(snow[i].style.left)>(marginright-3*lftrght[i])){
if (snowingzone==1) {snow[i].posx=randommaker(marginright-snow[i].size)}
if (snowingzone==2) {snow[i].posx=randommaker(marginright/2-snow[i].size)}
if (snowingzone==3) {snow[i].posx=randommaker(marginright/2-snow[i].size)+marginright/4}
if (snowingzone==4) {snow[i].posx=randommaker(marginright/2-snow[i].size)+marginright/2}
snow[i].posy=0
}
}
var timer=setTimeout("movesnow()",50)
}
for (i=0;i<=snowmax;i++) {
document.write("<span id='s"+i+"' style='position:absolute;top:-"+snowmaxsize+"'>"+snowletter+"</span>")
}
if (browserok) {
window.onload=initsnow
}
</script>
이미지 크기에 맞는 팝업창 띠우기
function popupImage(imageURL)
{
imageHandle=open("","popupForImage","toolbar=no,location=no,status=no,manubar=no,scrollbars=no,resizable=yes,width=100,height=100,top=100,left=50");
imageHandle.document.write("Image View");
imageHandle.document.write("");
imageHandle.document.write("*{margin:0;padding:0;border:0;}");
imageHandle.document.write("");
imageHandle.document.write("");
}
위의 스크립트를 <head>와 </head> 사이에 두고
<a href="javascript:popupImage('큰이미지')" onFocus="this.blur();"><img src="작은이미지"></a>
마우스 주위에 뱅글뱅글 도는 글 애니만들기
....
<SCRIPT LANGUAGE="xxJavaScript">
<!--
if (document.all) {
yourLogo = "라뷰해여~ 이쁜냔^-^!"; // 마우스 주위에 나타날 글자 를 써주세요.
logoFont = "돋움체"; // 글자체
logoColor = "#FDB7CE"; // 글자색
yourLogo = yourLogo.split('');
L = yourLogo.length;
TrigSplit = 360 / L;
Sz = new Array()
logoWidth = 30; // 장평 글자 간격입니다. 원의 크기 이겠죠!!
logoHeight = -30; // 글자의 크기 입니다. (여기서 - 는 반시계 반향 이고 지우면 시계방향으로 가요~)
ypos = 0;
xpos = 0;
step = 0.07; // 속도를 조절할 수 있습니다.
currStep = 0;
document.write('<div id="outer" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i = 0; i < L; i++) {
document.write('<div id="ie" style="position:absolute;top:0px;left:0px;'
+'width:10px;height:10px;font-family:'+logoFont+';font-size:12px;'
+'color:'+logoColor+';text-align:center">'+yourLogo[i]+'</div>'); }
document.write('</div></div>');
function Mouse()
{ ypos = event.y;
xpos = event.x - 5; }
document.xxonmousemove=Mouse;
function animateLogo() {
outer.style.pixelTop = document.body.scrollTop;
for (i = 0; i < L; i++) {
ie[i].style.top = ypos + logoHeight * Math.sin(currStep + i * TrigSplit * Math.PI / 180);
ie[i].style.left = xpos + logoWidth * Math.cos(currStep + i * TrigSplit * Math.PI / 180);
Sz[i] = ie[i].style.pixelTop - ypos;
if (Sz[i] < 5) Sz[i] = 5;
ie[i].style.fontSize = Sz[i] / 1.7; }
currStep -= step;
setTimeout('animateLogo()', 20); }
window.xxonload = animateLogo; }
//-->
</script>
페이지 오픈시 자동으로 시작페이지 설정하기
아래 소스를 사용하면 페이지를 오픈할 때 시작페이지를 자동으로 바꾸게 할 수 있습니다.
<html XMLNS:IE>
<head>
<script>
function MyStartHome()
{
if(!StartHomePage.isHomePage('http://www.filebest.com'))
StartHomePage.setHomePage('http://www.filebest.com');
}
</script>
<STYLE>
@media all { IE\:HOMEPAGE {behavior:url(#default#homepage)} }
</STYLE>
<IE:HOMEPAGE ID="StartHomePage" />
</head>
<body Onload="MyStartHome();" >
.....
</body>
</html>
홈페이지대문을 풀스크린 전체화면으로 뜨게 하기
첫화면을 풀스크린으로 뜨게하는 예제
아래 소스를 그냥 HTML 파일로 만들면 됩니다.
설명:
단, 아래 소스는 약간의 편법으로 만들어 진 것으로
먼저 기본 HTML에서 풀스크린으로 뛰울 HTML을 오픈하고 자기 자신은 창을 닫는 방식을 사용했습니다.
이 소스는 장점은 어떤 첫화면 풀스크린만들기 소스보다 소스가 간단합니다.
단점은 약간의 시간이 걸리고 또 중간에 다른창이 떳다가 사라지는 것 같은 화면이 잠시 나타납니다.
* 전체화면으로 뜬 창은 Alt+F4 키를 누르면 나갈 수 있습니다. 그러나
사용자들이 이것을 모르는 경우가 많기때문에 "닫기"버튼을 하나 만들어 주는 것이 좋습니다. 닫기 버튼은 이 게시판에서 "닫기"로 검색하면 찾을 수 있습니다.
예제:
<script>
popup=window.open("http://www.filebest.com","_blank","fullscreen,scrollbars")
</script>
<script>window.opener = window.location.href; self.close();</script>
공식
<script>
popup=window.open("연결할 URL경로","_blank","fullscreen,scrollbars")
</script>
<script>window.opener = window.location.href; self.close();</script>
위에서 하나 알 수 있느 것은 전체화면으로 뛰우기 위해서는 창옵션을 "fullscreen,scrollbars") 으로 하라는 것입니다.
마우스 따라다니는 정렬된 예쁜 글자들
[HTML ] 마우스 따라다니는 정렬된 예쁜 글자들
이름
: Uploader1 작성일 : 2004-01-17 10:43:15 조회 : 120
과정1)
헤드와 헤드사이에 삽입
<head>
............
............
<style type="text/css">
.spanstyle {position:absolute; visibility:visible; top:-50px; font-size:9pt; font-family:돋움; color:blue;}
</style>
<script>
/*
Cursor Trailor Text- By Peter Gehrig (http://www.24fun.ch/)
Permission given to Dynamicdrive.com to feature script in it's archive.
*/
var x,y
var step=20
var flag=0
// Your snappy message. Important: the space at the end of the sentence!!!
var message="여기에 원하는 글을 쓰세요~"
message=message.split("")
var xpos=new Array()
for (i=0;i<=message.length-1;i++) {
xpos[i]=-50
}
var ypos=new Array()
for (i=0;i<=message.length-1;i++) {
ypos[i]=-50
}
function handlerMM(e){
x = (document.layers) ? e.pageX : document.body.scrollLeft+event.clientX
y = (document.layers) ? e.pageY : document.body.scrollTop+event.clientY
flag=1
}
function makesnake() {
if (flag==1 && document.all) {
for (i=message.length-1; i>=1; i--) {
xpos[i]=xpos[i-1]+step
ypos[i]=ypos[i-1]
}
xpos[0]=x+step
ypos[0]=y
for (i=0; i<message.length-1; i++) {
var thisspan = eval("span"+(i)+".style")
thisspan.posLeft=xpos[i]
thisspan.posTop=ypos[i]
}
}
else if (flag==1 && document.layers) {
for (i=message.length-1; i>=1; i--) {
xpos[i]=xpos[i-1]+step
ypos[i]=ypos[i-1]
}
xpos[0]=x+step
ypos[0]=y
for (i=0; i<message.length-1; i++) {
var thisspan = eval("document.span"+i)
thisspan.left=xpos[i]
thisspan.top=ypos[i]
}
}
var timer=setTimeout("makesnake()",30)
}
</script>
............
............
</head>
과정2)
<Body> 태그를 아래와 같이 수정해주세요.
<body onload="makesnake()" style="width:100%; overflow-x:hidden; overflow-y:scroll">
과정3)
<Body> </Body> 사이에 아래를 넣어주세요.
<body>
..............
<script>
<!-- Beginning of JavaScript -
for (i=0;i<=message.length-1;i++) {
document.write("<span id='span"+i+"' class='spanstyle'>")
document.write(message[i])
document.write("</span>")
}
if (document.layers){
document.captureEvents(Event.MOUSEMOVE);
}
document.onmousemove = handlerMM;
// - End of JavaScript - -->
</script>
............
</body>
위에서 ............는 이것저것 다른 소스를 의미합니다.
링크 클릭시 사운드 효과
[HTML] 링크 클릭시 사운드 효과
이름
: Uploader1 작성일 : 2004-01-17 11:21:57 조회 : 60
과정1- 해드와 해드사이에 넣어주세요.
<head>
<bgsound id=music loop="1">
<script>
function bgsoundcall(str)
{
eval(str);
}
</script>
</head>
옵션- 위 소스에서 <bgsound id=music loop="1">에서 "1"은 사운드 연주 횟수입니다. 1이면 1회 지요...
과정2- 바디에 넣어주세요.
<body>
<a OnClick="bgsoundcall('music.src=사운드파일명'');">연결하기</a>
'공부 이야기 > 컴퓨터 몽땅' 카테고리의 다른 글
| RGB to YUV 색공간 변경 (0) | 2009/10/16 |
|---|---|
| wav 파일로 녹음하기 (0) | 2009/08/04 |
| Javascript 팁 (0) | 2009/07/14 |
| How do I get a list of network interfaces and their IP and MAC addresses? (0) | 2009/01/19 |
| 컴퓨터끼리 네트웍속도 측정툴 Iperf (1) | 2008/11/28 |
| *윈도우 XP 정품인증 받기* (1) | 2008/10/20 |


이올린에 북마크하기


