Jump to content
xisto Community
Sign in to follow this  
Fspears

Javascript Scripts BEWARE: Huge Thread

Recommended Posts

this script to make a flying window just pase it in the header

<script>var x=0, y=20, dx=4, dy=4, interval=10;var win= window.open('javascript:"<HTML><HEAD><TITLE>Floater</TITLE></HEAD><BODY><center><img width=200 height=200 src=pic.jpg></center></BODY></HTML>"', "","width=200,height=100,screenY=20");win.moveTo(x,y);var intervalID=window.setInterval("bounce()",interval);var sw=screen.availWidth-210var sh=screen.availHeight-100function bounce(){	if (win.closed) {	clearInterval(intervalID);	return;	}if ((x+dx > sw) || (x+dx < 0)) dx = -dx;if ((y+dy > sh) || (y+dy < 0)) dy = -dy;x += dxy += dywin.moveTo(x,y)}</script>

Edited by lhunath (see edit history)

Share this post


Link to post
Share on other sites

this code very nice make like an earthquake in your window try it>>>>>

<script language="JavaScript1.2"><!-- Beginfunction shake(n) {if (self.moveBy) {for (i = 10; i > 0; i--) {for (j = n; j > 0; j--) {self.moveBy(0,i);self.moveBy(i,0);self.moveBy(0,-i);self.moveBy(-i,0);         }      }   }}// End --></script><form>    <p align="center"><input type="button"    value="quake" onclick="shake(2)"> </p></form>

:):P:P:)

Edited by lhunath (see edit history)

Share this post


Link to post
Share on other sites

try this and you will be very happy :)

 

 

<html>
<head>
<script language="JavaScript">

<!-- Begin
fCol='0000ff';//face colour.
dCol='000000';//dot colour.
hCol='ff0000';//hours colour.
mCol='green';//minutes colour.
sCol='7788ff';//seconds colour.
ClockHeight=35;
ClockWidth=35;
ClockFromMouseY=10;
ClockFromMouseX=5;

//Alter nothing below! Alignments will be lost!
ns=(document.layers);
ie=(document.all);
h=4;
m=5;
s=5;
face='1 2 3 4 5 6 7 8 9 10 11 12';
face=face.split(' ');
n=face.length;
speed=0.6;
ymouse=0;
xmouse=0;
scrll=0;
p="<font face=Arial size=4 color="+fCol+">";
e=360/n;
HandHeight=ClockHeight/4;
HandWidth=ClockWidth/4;
HandY=0;
HandX=0;
scrll=0;
y=new Array();x=new Array();Y=new Array();X=new Array();
for (i=0; i < 37; i++){y[i]=0;x[i]=0;Y[i]=0;X[i]=0}
Dy=new Array();Dx=new Array();DY=new Array();DX=new Array();
for (i=0; i < n; i++){Dy[i]=0;Dx[i]=0;DY[i]=0;DX[i]=0}
if (ns){
for (i=0; i < n; i++)
document.write('<layer name="nsN'+i+'" top=0 left=0 height=15 width=15><center>'+p+face[i]+'</font></center></layer>');
for (i=0; i < n; i++)
document.write('<layer name="nsD'+i+'" top=0 left=0 bgcolor='+dCol+' clip="0,0,2,2"></layer>');
for (i=0; i < h; i++)
document.write('<layer name=nsH'+i+' top=0 left=0 bgcolor='+hCol+' clip="0,0,2,2"></layer>');
for (i=0; i < m; i++)
document.write('<layer name=nsM'+i+' top=0 left=0 bgcolor='+mCol+' clip="0,0,2,2"></layer>');
for (i=0; i < s; i++)
document.write('<layer name=nsS'+i+' top=0 left=0 bgcolor='+sCol+' clip="0,0,2,2"></layer>');
}
if (ie){
document.write('<div id="On" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i=0; i < n; i++)
document.write('<div id="ieN" style="position:absolute;width:15px;height:15px;text-align:center">'+p+face[i]+'</font></div>');
document.write('</div></div>');
document.write('<div id="Od" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i=0; i < n; i++)
document.write('<div id="ieD" style="position:absolute;height:2px;width:2px;font-size:2px;background:'+dCol+'"></div>');
document.write('</div></div>');
document.write('<div id="Oh" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i=0; i < h; i++)
document.write('<div id="ieH" style="position:absolute;width:2px;height:2px;font-size:2px;background:'+hCol+'"></div>');
document.write('</div></div>');
document.write('<div id="Om" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i=0; i < m; i++)
document.write('<div id="ieM" style="position:absolute;width:2px;height:2px;font-size:2px;background:'+mCol+'"></div>');
document.write('</div></div>')
document.write('<div id="Os" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i=0; i < s; i++)
document.write('<div id="ieS" style="position:absolute;width:2px;height:2px;font-size:2px;background:'+sCol+'"></div>');
document.write('</div></div>')
}

(ns)?window.captureEvents(Event.MOUSEMOVE):0;
function Mouse(evnt){
ymouse = (ns)?evnt.pageY+ClockFromMouseY-(window.pageYOffset):event.y+ClockFromMouseY;
xmouse = (ns)?evnt.pageX+ClockFromMouseX:event.x+ClockFromMouseX;
}
(ns)?window.onMouseMove=Mouse:document.onmousemove=Mouse;

function ClockAndAssign(){
time = new Date ();
secs = time.getSeconds();
sec = -1.57 + Math.PI * secs/30;
mins = time.getMinutes();
min = -1.57 + Math.PI * mins/30;
hr = time.getHours();
hrs = -1.575 + Math.PI * hr/6+Math.PI*parseInt(time.getMinutes())/360;
if (ie){
On.style.top=window.document.body.scrollTop;
Od.style.top=window.document.body.scrollTop;
Oh.style.top=window.document.body.scrollTop;
Om.style.top=window.document.body.scrollTop;
Os.style.top=window.document.body.scrollTop;
}
for (i=0; i < s; i++){
var sd=(ns)?document.layers['nsS'+i]:ieS[i].style;
sd.top=y[8+i]+HandY+(i*HandHeight)*Math.sin(sec)+scrll;
sd.left=x[8+i]+HandX+(i*HandWidth)*Math.cos(sec);
}
for (i=0; i < m; i++){
var md=(ns)?document.layers['nsM'+i]:ieM[i].style;
md.top=y[4+i]+HandY+(i*HandHeight)*Math.sin(min)+scrll;
md.left=x[4+i]+HandX+(i*HandWidth)*Math.cos(min);
}
for (i=0; i < h; i++){
var hd=(ns)?document.layers['nsH'+i]:ieH[i].style;
hd.top=y[1+i]+HandY+(i*HandHeight)*Math.sin(hrs)+scrll;
hd.left=x[1+i]+HandX+(i*HandWidth)*Math.cos(hrs);
}
for (i=0; i < n; i++){
var D=(ns)?document.layers['nsD'+i]:ieD[i].style;
D.top=y[13+i] + ClockHeight*Math.sin(-1.0471 + i*e*Math.PI/180)+scrll;
D.left=x[13+i] + ClockWidth*Math.cos(-1.0471 + i*e*Math.PI/180);
}
for (i=0; i < n; i++){
var N=(ns)?document.layers['nsN'+i]:ieN[i].style;
N.top=y[25+i]-6 + ClockHeight*1.4*Math.sin(-1.0471 + i*e*Math.PI/180)+scrll;
N.left=x[25+i]-6 + ClockWidth*1.4*Math.cos(-1.0471 + i*e*Math.PI/180);
}
}

function Delay(){
scrll=(ns)?window.pageYOffset:0;
y[0]=Math.round(Y[0]+=((ymouse)-Y[0])*speed);
x[0]=Math.round(X[0]+=((xmouse)-X[0])*speed);
for (i=1; i < 37; i++){
y[i]=Math.round(Y[i]+=(y[i-1]-Y[i])*speed);
x[i]=Math.round(X[i]+=(x[i-1]-X[i])*speed);
}
ClockAndAssign();
setTimeout('Delay()',20);
}
if (ns||ie)window.onload=Delay;
//  End -->
</script>
</head>

<body>
</body>
</html>

 

HTML Fixed by Lhunath

Edited by lhunath (see edit history)

Share this post


Link to post
Share on other sites

code to make crosshairs

<style><!--#leftright, #topdown{position:absolute;left:0;top:0;width:1px;height:1px;layer-background-color:black;background-color:black;z-index:100;font-size:1px;}--></style>  <div id="leftright" style="width:expression(document.body.clientWidth-2)">				</div>				<div id="topdown" style="height:expression(document.body.clientHeight-2)">				</div>				<script language="JavaScript1.2"><!--if (document.all&amp;amp;amp;amp;amp;amp;&amp;amp;amp;amp;amp;amp;!window.print){leftright.style.width=document.body.clientWidth-2topdown.style.height=document.body.clientHeight-2}else if (document.layers){document.leftright.clip.width=window.innerWidthdocument.leftright.clip.height=1document.topdown.clip.width=1document.topdown.clip.height=window.innerHeight}function followmouse1(){//move cross engine for IE 4+leftright.style.pixelTop=document.body.scrollTop+event.clientY+1topdown.style.pixelTop=document.body.scrollTopif (event.clientX<document.body.clientWidth-2)topdown.style.pixelLeft=document.body.scrollLeft+event.clientX+1elsetopdown.style.pixelLeft=document.body.clientWidth-2}function followmouse2(e){//move cross engine for NS 4+document.leftright.top=e.y+1document.topdown.top=pageYOffsetdocument.topdown.left=e.x+1}if (document.all)document.onmousemove=followmouse1else if (document.layers){window.captureEvents(Event.MOUSEMOVE)window.onmousemove=followmouse2}function regenerate(){window.location.reload()}function regenerate2(){setTimeout("window.onresize=regenerate",400)}if ((document.all&amp;amp;amp;amp;amp;amp;&amp;amp;amp;amp;amp;amp;!window.print)||document.layers)//if the user is using IE 4 or NS 4, both NOT IE 5+window.onload=regenerate2//--></script>

:):)

Edited by lhunath (see edit history)

Share this post


Link to post
Share on other sites

code to make pop up box

 

 

<script language="JavaScript1.2">


var ns4=document.layers
var ie4=document.all
var ns6=document.getElementById&amp;amp;amp;amp;amp;&amp;amp;amp;amp;amp;!document.all

//drag drop function for NS 4////
/////////////////////////////////

var dragswitch=0
var nsx
var nsy
var nstemp

function drag_dropns(name){
if (!ns4)
return
temp=eval(name)
temp.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP)
temp.onmousedown=gons
temp.onmousemove=dragns
temp.onmouseup=stopns
}

function gons(e){
temp.captureEvents(Event.MOUSEMOVE)
nsx=e.x
nsy=e.y
}
function dragns(e){
if (dragswitch==1){
temp.moveBy(e.x-nsx,e.y-nsy)
return false
}
}

function stopns(){
temp.releaseEvents(Event.MOUSEMOVE)
}

//drag drop function for ie4+ and NS6////
/////////////////////////////////


function drag_drop(e){
if (ie4&amp;amp;amp;amp;amp;&amp;amp;amp;amp;amp;dragapproved){
crossobj.style.left=tempx+event.clientX-offsetx
crossobj.style.top=tempy+event.clientY-offsety
return false
}
else if (ns6&amp;amp;amp;amp;amp;&amp;amp;amp;amp;amp;dragapproved){
crossobj.style.left=tempx+e.clientX-offsetx
crossobj.style.top=tempy+e.clientY-offsety
return false
}
}

function initializedrag(e){
crossobj=ns6? document.getElementById("showimage") : document.all.showimage

var firedobj=ns6? e.target : event.srcElement
var topelement=ns6? "HTML" : "BODY"

while (firedobj.tagName!=topelement&amp;amp;amp;amp;amp;&amp;amp;amp;amp;amp;firedobj.id!="dragbar"){
firedobj=ns6? firedobj.parentNode : firedobj.parentElement
}

if (firedobj.id=="dragbar"){
offsetx=ie4? event.clientX : e.clientX
offsety=ie4? event.clientY : e.clientY

tempx=parseInt(crossobj.style.left)
tempy=parseInt(crossobj.style.top)

dragapproved=true
document.onmousemove=drag_drop
}
}
document.onmousedown=initializedrag
document.onmouseup=new Function("dragapproved=false")

////drag drop functions end here//////

function hidebox(){
if (ie4||ns6)
crossobj.style.visibility="hidden"
else if (ns4)
document.showimage.visibility="hide"
}

</script>
</head>

<body>
<div id="showimage" style="position:absolute;width:250px;left:250;top:250">

<table border="0" width="250" bgcolor="#000080" cellspacing="0" cellpadding="2">
 <tr>
   <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0"
   height="36">
     <tr>
       <td id="dragbar" style="cursor:hand" width="100%"><ilayer width="100%" onSelectStart="return false"><layer width="100%" onMouseover="dragswitch=1;if (ns4) drag_dropns(showimage)" onMouseout="dragswitch=0"><font face="Verdana"
       color="#FFFFFF"><strong><small>Announcement Box</small></strong></font></layer></ilayer></td>
       <td style="cursor:hand"><a href="#" onClick="hidebox();return false"><img src="close.gif" width="16"
       height="14" border=0></a></td>
     </tr>
     <tr>
       <td width="100%" bgcolor="#FFFFFF" style="padding:4px" colspan="2">

<!-- PUT YOUR CONTENT BETWEEN HERE ---->

I am typing now.

<!-- END YOUR CONTENT HERE----->

</div></a>

HTML (hopeless) kinda Fixed by Lhunath

Edited by lhunath (see edit history)

Share this post


Link to post
Share on other sites

code to stop ppl right clicking your site

<script language="JavaScript">var message="";///////////////////////////////////function clickIE() {if (document.all) {(message);return false;}}function clickNS(e) {if(document.layers||(document.getElementById&amp;amp;amp;amp;amp;&amp;amp;amp;amp;amp;!document.all)) {if (e.which==2||e.which==3) {(message);return false;}}}if (document.layers){document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}</script>

Edited by lhunath (see edit history)

Share this post


Link to post
Share on other sites

code to make status bar marqee

 

<head>

<script language="JavaScript">

<!-- Begin
function scrollit(seed) {
var m1  = "Message  ";
var m2  = "Message ";
var m3  = "Message ";
var m4  = "";
var msg=m1+m2+m3+m4;
var out = " ";
var c   = 1;
if (seed > 100) {
seed--;
cmd="scrollit("+seed+")";
timerTwo=window.setTimeout(cmd,100);
}
else if (seed <= 100 &amp;amp;amp;amp;amp;amp;&amp;amp;amp;amp;amp;amp; seed > 0) {
for (c=0 ; c < seed ; c++) {
out+=" ";
}
out+=msg;
seed--;
window.status=out;
cmd="scrollit("+seed+")";
timerTwo=window.setTimeout(cmd,100);
}
else if (seed <= 0) {
if (-seed < msg.length) {
out+=msg.substring(-seed,msg.length);
seed--;
window.status=out;
cmd="scrollit("+seed+")";
timerTwo=window.setTimeout(cmd,100);
}
else {
window.status=" ";
timerTwo=window.setTimeout("scrollit(100)",75);
     }
  }
}
// End -->
</script>

</head>
<body onLoad="scrollit(100)">

HTML Fixed by Lhunath

Edited by lhunath (see edit history)

Share this post


Link to post
Share on other sites

code to make status bar message scroll

<head>
<script language="JavaScript">


<!-- Begin
var hellotext = "WORDS TO SCROLL"
var thetext = "";
var started = false;
var step = 0;
var times = 1;

function welcometext() {
times--;
if (!times) {
if (!started) {
started = true;
window.status = hellotext;
setTimeout("anim()", 1);
}
thetext = hellotext;
  }
}

function anim() {
step++;
if (step==7) step = 1;
if (step==1) window.status = '.   ' + thetext + '   .';
if (step==2) window.status = '..  ' + thetext + '  ..';
if (step==3) window.status = '..: ' + thetext + ' :..';
if (step==4) window.status = '..::' + thetext + '::..';
if (step==5) window.status = '..::' + thetext + '::..';
if (step==6) window.status = '..::' + thetext + '::..'
setTimeout("anim()", 200);
}
//  End -->
</script>

</head>
<body OnLoad="welcometext()">

HTML Fixed by Lhunath

Edited by lhunath (see edit history)

Share this post


Link to post
Share on other sites

code for colored bars

<style>BODY {	SCROLLBAR-FACE-COLOR: #000000; SCROLLBAR-HIGHLIGHT-COLOR: #000000; SCROLLBAR-SHADOW-COLOR: #000000; SCROLLBAR-3DLIGHT-COLOR: #000000; SCROLLBAR-ARROW-COLOR: #000000; SCROLLBAR-TRACK-COLOR: #000000}</style>

Edited by lhunath (see edit history)

Share this post


Link to post
Share on other sites

code to get ip adress

<script LANGUAGE="JavaScript"><!-- Begin// Depending on your server set-up,// you may need to use the ".shtml"// extension [instead of the "html"// or "htm"] as the script uses Server// Side Includes. To display in the// title bar, exclude the//"<title></title>" code from the page.// This part gets the IPvar ip = '<!--#echo var="REMOTE_ADDR"-->';// This part is for an alert boxalert("Your IP address is "+ip);// This part is for the status barwindow.defaultStatus = "Your IP address is "+ip;// This part is for the title bardocument.write("<title>Your IP address is "+ip+"</title>");//  End --></script>

Edited by lhunath (see edit history)

Share this post


Link to post
Share on other sites

<html>
<head>
<script>
function compute(obj) 
  {obj.expr.value = eval(obj.expr.value)}
var one = '1'
var two = '2'
var three = '3'
var four = '4'
var five = '5'
var six = '6'
var seven = '7'
var eight = '8'
var nine = '9'
var zero = '0'
var plus = '+'
var minus = '-'
var multiply = '*'
var divide = '/'
var decimal = '.'
function enter(obj, string) 
  {obj.expr.value += string}
function clear(obj) 
  {obj.expr.value = ''}
</script>
</head>

<body>
<p align="center"><font color="#000000" size="3"
face="Verdana, Arial, Helvetica, sans-serif"><strong></strong></font><strong> </strong></p>

<form name="calc">
   <div align="center"><center><table border="1"
   bgcolor="#FFEAFF">
       <tr>
           <td colspan="4"><input type="text" size="30"
           name="expr" action="compute(this.form)"> </td>
       </tr>
       <tr>
           <td><p align="center"><input type="button"
           value="  7  " onclick="enter(this.form, seven)"> </p>
           </td>
           <td><p align="center"><input type="button"
           value="  8  " onclick="enter(this.form, eight)"> </p>
           </td>
           <td><p align="center"><input type="button"
           value="  9  " onclick="enter(this.form, nine)"> </p>
           </td>
           <td><p align="center"><input type="button"
           value="   /  " onclick="enter(this.form, divide)"> </p>
           </td>
       </tr>
       <tr>
           <td><p align="center"><input type="button"
           value="  4  " onclick="enter(this.form, four)"> </p>
           </td>
           <td><p align="center"><input type="button"
           value="  5  " onclick="enter(this.form, five)"> </p>
           </td>
           <td><p align="center"><input type="button"
           value="  6  " onclick="enter(this.form, six)"> </p>
           </td>
           <td><p align="center"><input type="button"
           value="  *  " onclick="enter(this.form, multiply)"> </p>
           </td>
       </tr>
       <tr>
           <td><p align="center"><input type="button"
           value="  1  " onclick="enter(this.form, one)"> </p>
           </td>
           <td><p align="center"><input type="button"
           value="  2  " onclick="enter(this.form, two)"> </p>
           </td>
           <td><p align="center"><input type="button"
           value="  3  " onclick="enter(this.form, three)"> </p>
           </td>
           <td><p align="center"><input type="button"
           value="   -  " onclick="enter(this.form, minus)"> </p>
           </td>
       </tr>
       <tr>
           <td colspan="2"><p align="center"><input
           type="button" value="       0       "
           onclick="enter(this.form, zero)"> </p>
           </td>
           <td><p align="center"><input type="button"
           value="   .  " onclick="enter(this.form, decimal)"> </p>
           </td>
           <td><p align="center"><input type="button"
           value="  +  " onclick="enter(this.form, plus)"> </p>
           </td>
       </tr>
       <tr>
           <td colspan="2"><p align="center"><input
           type="button" value="   =   "
           onclick="compute(this.form)"> </p>
           </td>
           <td colspan="2"><p align="center"><input type="reset"
           value="AC" onclick="clear(this.form)"> </p>
           </td>
       </tr>
   </table>
   </center></div>
</form>
</body>
</html>

HTML Fixed by Lhunath

Edited by lhunath (see edit history)

Share this post


Link to post
Share on other sites

Words following the mouse pointer:

 

<html>

<head>
 <title>mouse</title>
<style>.spanstyle {
COLOR: white; FONT-FAMILY: Verdana; FONT-SIZE: 8pt; FONT-WEIGHT: bold; POSITION: absolute; TOP: -50px; VISIBILITY: visible
}
</style>

<script language="JavaScript">

var x, y;
var step = 10;
var flag = 0;

var message = "your text";
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()", 10);
}
// End -->
</script>
</head>

<body onload="makesnake()"
style="overflow: hidden; WIDTH: 100%">

<script language="JavaScript">
<!-- Begin
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 -->
</script>

<//--><//"--><!-- VC layer -->
<script LANGUAGE="JavaScript">
<!--
document.write('<LAYER SRC="' + ValueBanner + '&t=html" WIDTH="' + IWidth
+ '" ');
document.write('HEIGHT="' + IHeight + '" VISIBILITY="hide" onLoad=');
document.write('"moveToAbsolute(VC.pageX,VC.pageY); clip.width=' + IWidth
+ '; ');
document.write('clip.height=' + IHeight +
'; visibility=\'show\'"></LAYER>');
// -->
</script>
<!-- vc layer -->
</body>
</html>

HTML Fixed by Lhunath

Edited by lhunath (see edit history)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.