javascript for blog

Tulisan Matrix

——-
Script ini hanya jalan di Internet Explorer
——-

contoh buka: http://www.ilmuwebsite.com/javascript/javascript-matrix.htm

<html>
<head>
</head>
<body bgcolor=”#000000″>
<STYLE type=text/css>#supertext {
LEFT: 0px; VISIBILITY: hidden; POSITION: absolute; TOP: 0px
}
</STYLE>

<SCRIPT language=JavaScript1.2>

//Configure the below three variables

//1) Set message to display (HTML accepted)
var thecontent=’<h2><font face=”Courier New” font size=”5″ color=”#00FF00″>ilmuwebsite.com – Webmaster Resource</font></h2>’
//2) Set delay after which message should be hidden, in miliseconds (” makes it incessantly visible on the screen)
var hidetimer=”;
//3) Set speed of animation (1-50), where larger is faster
var BallSpeed = 20;

///NO NEED TO EDIT BELOW THIS LINE///////////

var contentWidth;
var contentHeight;
var maxBallSpeed = 50;

var xMax;
var yMax;
var xPos = 0;
var yPos = 0;
var xDir = ‘right’;
var yDir = ‘down’;
var superballRunning = true;
var tempBallSpeed;
var currentBallSrc;
var newXDir;
var newYDir;

function initializeBall() {
if (document.all) {
xMax = document.body.clientWidth
yMax = document.body.clientHeight
document.all(”supertext”).style.visibility = “visible”;
contentWidth=supertext.offsetWidth
contentHeight=supertext.offsetHeight
}
else if (document.layers) {
xMax = window.innerWidth;
yMax = window.innerHeight;
contentWidth=document.supertext.document.width
contentHeight=document.supertext.document.height
document.layers[“supertext”].visibility = “show”;
}
setTimeout(’moveBall()’,400);
if (hidetimer!=”)
setTimeout(”hidetext()”,hidetimer)
}

function moveBall() {
if (superballRunning == true) {
calculatePosition();
if (document.all) {
document.all(”supertext”).style.left = xPos + document.body.scrollLeft;
document.all(”supertext”).style.top = yPos + document.body.scrollTop;
}
else if (document.layers) {
document.layers[“supertext”].left = xPos + pageXOffset;
document.layers[“supertext”].top = yPos + pageYOffset;
}
animatetext=setTimeout(’moveBall()’,20);
}
}

function calculatePosition() {
if (xDir == “right”) {
if (xPos > (xMax – contentWidth – BallSpeed)) {
xDir = “left”;
}
}
else if (xDir == “left”) {
if (xPos < (0 + BallSpeed)) {
xDir = “right”;
}
}
if (yDir == “down”) {
if (yPos > (yMax – contentHeight – BallSpeed)) {
yDir = “up”;
}
}
else if (yDir == “up”) {
if (yPos < (0 + BallSpeed)) {
yDir = “down”;
}
}
if (xDir == “right”) {
xPos = xPos + BallSpeed;
}
else if (xDir == “left”) {
xPos = xPos – BallSpeed;
}
else {
xPos = xPos;
}
if (yDir == “down”) {
yPos = yPos + BallSpeed;
}
else if (yDir == “up”) {
yPos = yPos – BallSpeed;
}
else {
yPos = yPos;
}
}

function hidetext(){
if (document.all)
supertext.style.visibility=”hidden”
else if (document.layers)
document.supertext.visibility=”hide”
clearTimeout(animatetext)
}

if (document.all||document.layers){
document.write(’<span id=”supertext”><nobr>’+thecontent+’</nobr></span>’)
window.onload = initializeBall;
window.onresize = new Function(”window.location.reload()”);
}

</SCRIPT>

<SCRIPT language=JavaScript>

if (document.all){

Cols=22;

Cl=18; //Peþpeþe geliþ mesafeleri!

Cs=110; //Sayfaya enine yayýlýþ mesafeleri!

Ts=12; //Rakamlarýn büyüklükleri!

Tc=’#00FF00′;//Renk

Tc1=’#00FF00′;//Renk1

MnS=22; //Akýþ hýzlarý!

MxS=50; //Akýþ hýzlarý!

I=Cs;

Sp=new Array();S=new Array();Y=new Array();

C=new Array();M=new Array();B=new Array();

RC=new Array();E=new Array();Tcc=new Array(0,1,7,9,3,2);

document.write(”<div id=’Container’ style=’position:absolute;top:0;left:-”+Cs+”‘>”);

document.write(”<div style=’position:relative’>”);

for(i=0; i < Cols; i++){

S[i]=I+=Cs;

document.write(”<div id=’A’ style=’position:absolute;top:0;font-family:Arial;font-size:”

+Ts+”px;left:”+S[i]+”;width:”+Ts+”px;height:0px;color:”+Tc+”;visibility:hidden’></div>”);

}

document.write(”</div></div>”);

for(j=0; j < Cols; j++){

RC[j]=1+Math.round(Math.random()*Cl);

Y[j]=0;

Sp[j]=Math.round(MnS+Math.random()*MxS);

for(i=0; i < RC[j]; i++){

B[i]=”;

C[i]=Math.round(Math.random()*1)+’ ‘;

M[j]=B[0]+=C[i];

}

}

function Cycle(){

Container.style.top=window.document.body.scrollTop;

for (i=0; i < Cols; i++){

var r = Math.floor(Math.random()*Tcc.length);

E[i] = ‘<font color=’+Tc1+’>’+Tcc[r]+’</font>’;

Y[i]+=Sp[i];

if (Y[i] > window.document.body.clientHeight){

for(i2=0; i2 < Cols; i2++){

RC[i2]=1+Math.round(Math.random()*Cl);

for(i3=0; i3 < RC[i2]; i3++){

B[i3]=”;

C[i3]=Math.round(Math.random()*1)+’ ‘;

C[Math.floor(Math.random()*i2)]=’ ‘+’ ‘;

M[i]=B[0]+=C[i3];

Y[i]=-Ts*M[i].length/1.5;

A[i].style.visibility=’visible’;

}

Sp[i]=Math.round(MnS+Math.random()*MxS);

}

}

A[i].style.top=Y[i];

A[i].innerHTML=M[i]+’ ‘+E[i]+’ ‘;

}

setTimeout(’Cycle()’,20)

}

Cycle();

}

</SCRIPT>
</body>
</html>

Sumber dari situs Ilmu Website dalam kategori javascript dengan judul Tulisan Matrix

Noise di Mouse

letakkan di body

<SCRIPT language=JavaScript>
<!–

/*
Dancing Stars cursor (Submitted by J4mbi H4ck3r)
Modified and permission granted to Dynamic Drive to feature script in archive
For full source, usage terms, and 100’s more DHTML scripts, visit http://dynamicdrive.com
*/

if (document.all){
document.write(‘<div id=”starsDiv” style=”position:absolute;top:0px;left:0px”>’)
for (xy=0;xy<7;xy++)
document.write(‘<div style=”position:relative;width:3px;height:3px;background:#DBDBDB;font-size:2px;visibility:visible”></div>’)
document.write(‘</div>’)
}

if (document.layers)
{window.captureEvents(Event.MOUSEMOVE);}
var yBase = 200;
var xBase = 200;
var yAmpl = 10;
var yMax = 40;
var step = .2;
var ystep = .5;
var currStep = 0;
var tAmpl=1;
var Xpos = 1;
var Ypos = 1;
var i = 0;
var j = 0;

if (document.all)
{
function MoveHandler(){
Xpos = document.body.scrollLeft+event.x;
Ypos = document.body.scrollTop+event.y;
}
document.onmousemove = MoveHandler;
}

else if (document.layers)
{
function xMoveHandler(evnt){
Xpos = evnt.pageX;
Ypos = evnt.pageY;
}
window.onMouseMove = xMoveHandler;
}

function animateLogo() {
if (document.all)
{
yBase = window.document.body.offsetHeight/4;
xBase = window.document.body.offsetWidth/4;
}
else if (document.layers)
{
yBase = window.innerHeight/4 ;
xBase = window.innerWidth/4;
}

if (document.all)
{
var totaldivs=document.all.starsDiv.all.length
for ( i = 0 ; i < totaldivs ; i++ )
{
var tempdiv=document.all.starsDiv.all[i].style
tempdiv.top = Ypos + Math.cos((20*Math.sin(currStep/20))+i*70)*yBase*(Math.sin(10+currStep/10)+0.2)*Math.cos((currStep + i*25)/10);
tempdiv.left = Xpos + Math.sin((20*Math.sin(currStep/20))+i*70)*xBase*(Math.sin(10+currStep/10)+0.2)*Math.cos((currStep + i*25)/10);
}
}

else if (document.layers)
{
for ( j = 0 ; j < 7 ; j++ )
{
var templayer=”a”+j
document.layers[templayer].top = Ypos + Math.cos((20*Math.sin(currStep/20))+j*70)*yBase*(Math.sin(10+currStep/10)+0.2)*Math.cos((currStep + j*25)/10);
document.layers[templayer].left =Xpos + Math.sin((20*Math.sin(currStep/20))+j*70)*xBase*(Math.sin(10+currStep/10)+0.2)*Math.cos((currStep + j*25)/10);
}
}
currStep += step;
setTimeout(“animateLogo()”, 15);
}
animateLogo();
// –>
</SCRIPT>

Sumber dari situs Ilmu Website dalam kategori javascript dengan judul Noise di Mouse

Jam di Status Bar

<html>

<head>
<SCRIPT language=JavaScript>
<!–

function Clock() {

window.setTimeout( “Clock()”, 1000 );

now = new Date();
localtime = now.toString();
hours = now.getHours();
mins = now.getMinutes();
secs = now.getSeconds();
if (hours > 12)
hours = now.getHours()-12;
self.status = “Jam ” + hours + ” Lewat ” + mins + ” Menit, ” + secs + ” Detik Waktu Indonesia Bagian Ilmuwebsite.com “.toString();

}
Clock()
// –>
</SCRIPT>
</head>

<body>
<body bgcolor=”#000000”>

</body>
</html>

Sumber dari situs Ilmu Website dalam kategori javascript dengan judul Jam di Status Bar

Hujan Cinta
————–
Script ini hanya jalan di Internet Explorer
————–

contoh buka: http://www.ilmuwebsite.com/javascript/hujan-cinta.htm

<html>
<head>
</head>
<body bgcolor=”black”>

<body>
<!– file “ani_heart.gif” bisa kamu ganti sendiri terserah –>
<script language=”JavaScript1.2″>

<!– Begin
var no = 12; // number of hearts
var speed = 10; // smaller number moves the hearts faster
var heart = “ani_heart.gif”;
var flag;
var ns4up = (document.layers) ? 1 : 0;  // browser sniffer
var ie4up = (document.all) ? 1 : 0;

var dx, xp, yp;    // coordinate and position variables
var am, stx, sty;  // amplitude and step variables
var i, doc_width = 800, doc_height = 600;
if (ns4up) {
doc_width = self.innerWidth;
doc_height = self.innerHeight;
} else if (ie4up) {
doc_width = document.body.clientWidth;
doc_height = document.body.clientHeight;
}
dx = new Array();
xp = new Array();
yp = new Array();
amx = new Array();
amy = new Array();
stx = new Array();
sty = new Array();
flag = new Array();
for (i = 0; i < no; ++ i) {
dx[i] = 0;                        // set coordinate variables
xp[i] = Math.random()*(doc_width-30)+10;  // set position variables
yp[i] = Math.random()*doc_height;
amy[i] = 12+ Math.random()*20;         // set amplitude variables
amx[i] = 10+ Math.random()*40;
stx[i] = 0.02 + Math.random()/10; // set step variables
sty[i] = 0.7 + Math.random();     // set step variables
flag[i] = (Math.random()>0.5)?1:0;
if (ns4up) {                      // set layers
if (i == 0) {
document.write(“<layer name=\”dot”+ i +”\” left=\”15\” “);
document.write(“top=\”15\” visibility=\”show\”><img src=\””);
document.write(heart+ “\” border=\”0\”></layer>”);
} else {
document.write(“<layer name=\”dot”+ i +”\” left=\”15\” “);
document.write(“top=\”15\” visibility=\”show\”><img src=\””);
document.write(heart+ “\” border=\”0\”></layer>”);
}
} else
if (ie4up) {
if (i == 0) {
document.write(“<div id=\”dot”+ i +”\” style=\”POSITION: “);
document.write(“absolute; Z-INDEX: “+ i +”; VISIBILITY: “);
document.write(“visible; TOP: 15px; LEFT: 15px;\”><img src=\””);
document.write(heart+ “\” border=\”0\”></div>”);
} else {
document.write(“<div id=\”dot”+ i +”\” style=\”POSITION: “);
document.write(“absolute; Z-INDEX: “+ i +”; VISIBILITY: “);
document.write(“visible; TOP: 15px; LEFT: 15px;\”><img src=\””);
document.write(heart+ “\” border=\”0\”></div>”);
}
}
}

function snowNS() {  // Netscape main animation function
for (i = 0; i < no; ++ i) {  // iterate for every dot
if (yp[i] > doc_height-50) {
xp[i] = 10+ Math.random()*(doc_width-amx[i]-30);
yp[i] = 0;
flag[i]=(Math.random()<0.5)?1:0;
stx[i] = 0.02 + Math.random()/10;
sty[i] = 0.7 + Math.random();
doc_width = self.innerWidth;
doc_height = self.innerHeight;
}
if (flag[i])
dx[i] += stx[i];
else
dx[i] -= stx[i];
if (Math.abs(dx[i]) > Math.PI) {
yp[i]+=Math.abs(amy[i]*dx[i]);
xp[i]+=amx[i]*dx[i];
dx[i]=0;
flag[i]=!flag[i];
}
document.layers[“dot”+i].top = yp[i] + amy[i]*(Math.abs(Math.sin(dx[i])+dx[i]));
document.layers[“dot”+i].left = xp[i] + amx[i]*dx[i];

}
setTimeout(“snowNS()”, speed);
}

function snowIE() {  // IE main animation function
for (i = 0; i < no; ++ i) {  // iterate for every dot
if (yp[i] > doc_height-50) {
xp[i] = 10+ Math.random()*(doc_width-amx[i]-30);
yp[i] = 0;
stx[i] = 0.02 + Math.random()/10;
sty[i] = 0.7 + Math.random();
flag[i]=(Math.random()<0.5)?1:0;
doc_width = document.body.clientWidth;
doc_height = document.body.clientHeight;
}
if (flag[i])
dx[i] += stx[i];
else
dx[i] -= stx[i];
if (Math.abs(dx[i]) > Math.PI) {
yp[i]+=Math.abs(amy[i]*dx[i]);
xp[i]+=amx[i]*dx[i];
dx[i]=0;
flag[i]=!flag[i];
}

document.all[“dot”+i].style.pixelTop = yp[i] + amy[i]*(Math.abs(Math.sin(dx[i])+dx[i]));
document.all[“dot”+i].style.pixelLeft = xp[i] + amx[i]*dx[i];
}
setTimeout(“snowIE()”, speed);
}

if (ns4up) {
snowNS();
} else if (ie4up) {
snowIE();
}
// End –>
</script>
</center>
</body>
</html>

Sumber dari situs Ilmu Website dalam kategori javascript dengan judul Hujan Cinta

Gambar Mengikuti Scroll

<html>
<head>

<body topmargin=”0″ bgcolor=”#000000″>
<script>
if (!document.layers)
document.write(‘<div id=”divStayTopright” style=”position:absolute”>’)
</script>
</head>

<body bgcolor=”#000000″>

<layer id=”divStayTopright”>
<!–EDIT BELOW CODE TO YOUR OWN MENU–>
<table border=”0″ width=”130″ cellspacing=”0″ cellpadding=”0″>
<tr>
<td><img src=”TN_psd0810.JPG” width=”171″ height=”158″></td>
</tr>
</table>
<!–END OF EDIT–>
</layer>

<script type=”text/javascript”>
/*
Floating Menu script-  Roy Whittle (http://www.javascript-fx.com/)
Script featured on/available at http://www.dynamicdrive.com/
This notice must stay intact for use
*/
//Enter “frombottom” or “fromtop”
var verticalpos=”fromtop”

if (!document.layers)
document.write(‘</div>’)

function JSFX_FloatTopDiv()
{
var startX = 0,
startY = 0;
var ns = (navigator.appName.indexOf(“Netscape”) != -1);
var d = document;
function ml(id)
{
var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
if(d.layers)el.style=el;
el.sP=function(x,y){this.style.right=x;this.style.top=y;};
el.x = startX;
if (verticalpos==”fromtop”)
el.y = startY;
else{

el.y = ns ? pageYOffset + innerHeight :
document.body.scrollTop + document.body.clientHeight;
el.y -= startY;
}
return el;
}
window.stayTopright=function()
{
if (verticalpos==”fromtop”){
var pY = ns ? pageYOffset : document.body.scrollTop;
ftlObj.y += (pY + startY – ftlObj.y)/8;
}
else{

var pY = ns ? pageYOffset + innerHeight :
document.body.scrollTop + document.body.clientHeight;
ftlObj.y += (pY – startY – ftlObj.y)/8;
}
ftlObj.sP(ftlObj.x, ftlObj.y);
setTimeout(“stayTopright()”, 10);
}
ftlObj = ml(“divStayTopright”);
stayTopright();
}
JSFX_FloatTopDiv();
</script>

</body>
</html>

Sumber dari situs Ilmu Website dalam kategori javascript dengan judul Gambar mengikuti scroll

Klik Kanan Gempa
——-
Script ini hanya jalan di Internet Explorer

Jika anda klik kanan maka browser akan bergetar !!
——-

contoh buka: http://www.ilmuwebsite.com/javascript/klik-gempa.htm

<html>
<head>
</head>
<body bgcolor=”#000000″>

<SCRIPT language=JavaScript>
<!–inizio—–mess per copiare

document.onmousedown=click
function click() {
times2=0
if ((event.button==2) || (event.button==3))
{
alert(“Jangan klik kanan !!”);
shake(20)
}
}
function shake(n) {
if (parent.moveBy) {
for (i = 20; i > 0; i–) {
for (j = n; j > 0; j–) {
parent.moveBy(0,i);
parent.moveBy(i,0);
parent.moveBy(0,-i);
parent.moveBy(-i,0);
}
}
}
}
//fine copia–>
</SCRIPT>

</body>

</html>

Sumber dari situs Ilmu Website dalam kategori javascript dengan judul Klik kanan Gempa

Leave a comment

No comments yet.

Comments RSS TrackBack Identifier URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s