Thursday, October 16, 2008

JAVA SCRIPT FOR SHOWING MESSAGE IN STATUS BAR

message = "Welcome to Indira Gandhi National Open University^" + "http://www.ignou.ac.in is the official website of Indira Gandhi National Open University.^" + "^"
scrollSpeed = 25
lineDelay = 1500
txt = ""
function scrollText(pos)
{ if (message.charAt(pos) != '^')
{ txt = txt + message.charAt(pos) status = txt pauze = scrollSpeed
}
else
{ pauze = lineDelay txt = "" if (pos == message.length-1) pos = -1
} pos++ setTimeout("scrollText('"+pos+"')",pauze)
}
scrollText(0)

Sunday, September 14, 2008

The SetTimeout Function

So, you want to set things to happen after a certain amount of time? Well, the setTimeout function can help you create some nice scripts that will use time delays to make things happen. Let's take a look at how to call the setTimeout function:

setTimeout("yourfunction()",1000);

The first parameter is a string, which is going to be the function you want to use. This function was named "myfunction()". The second parameter is a number. This number is going to be the number of milliseconds the browser should wait before executing your function. Above, we have 1000 milliseconds, which will be 1 second.

Ex :--

  





Now, how did I get that text to change a second time while you were able to just watch? Let's look at the script for this trick: at following site



--------------------------------------------------------------------------------

http://www.pageresource.com/jscript/jtimeout.htm

Thursday, January 17, 2008

Use of Java Script for the text change event.

script type="text/javascript"

function findEmail() {
var areacode = document.getElementById("areacode").value;
var phone = document.getElementById("phone").value;
document.getElementById("tmo").innerHTML = areacode + phone + "@tmomail.net";
document.getElementById("cin").innerHTML = areacode + phone + "@mobile.mycingular.com";
document.getElementById("spr").innerHTML = areacode + phone + "@messaging.sprintpcs.com";
}
script
calling the Java Script function:-

<table class="content-table">
<tr><th>Carrier