Hindi, Kannada, malayalam, Tamil, Telugu music Discussion Board Online Radio

Simple Javascript Tricks

1. JavaScript isn't that scary
There are lots of simple ways to make your Freespace pages look professional and using simple JavaScript bits and bobs is one of them. You don't even need to learn how to write JavaScript, since there are many Websites that give you the source code for JavaScript effects for free. You might be asked to include a link to their site as a "Thank you", but you won't have to here, because these are the kind of every day extras that even someone who has never looked at Javascript before can use easily.

If you would like to learn more about Javascript, there are lots of good development sites on the web.

2. Mouseover text
This is one of the most simple JavaScripts to use. It is only one line long so it is good for beginners. onMouseOver makes a message appear in the status bar at the bottom of the screen when the mouse rolls over a particular link. To do this, you need to copy the text below and place it in a link's anchor tag, after the last quote mark:

onMouseOver="self.status='This is where you write your message!';return true"

So, for example, if you wanted to include a link to hyderabadsite on your own Freespace pages, and wanted a message describing hyderabadsite to appear in the status bar, you might write something like this.

<a href="http://www.hyderabadsite.com" onMouseOver="self.status='hyderabadsite.com is my favourite place to visit on the Web!';return true" > Go to hyderabadsite.com </a>

It would look like this: Go to hyderabadsite.com …and that's all there is to it.

3. Scrolling text box
A bit more complicated, but don't forget that you only have to copy and paste the code here on to your page. You don't have to actually program or write anything yourself.

Scrolling scripts can do their thing all over your browser, scrolling in the status bar, across the top of the screen or even appearing one letter at a time. This one is probably the least annoying!

This script is slightly different, and we found it at the Javascript Source, an excellent archive of scripts you can use any time. It is written in two parts; the first section needs to be copied into the "HEAD" section of your HTML, and the second within the "BODY" (you remember, so that it is in the bit of the page that gets published in the browser window itself). Don't worry about what it all means, if it works and you are interested, then you can learn more about Javascript by looking through the Netscape Javascript Manual, or getting the latest great Javascript book from us in the "Further reading" section.

Section 1 inbetween the <HEAD> tags:

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var display_text = "Put what you want to see "
+ " in between these quote marks "
+ " and you will find that it appears on the page instead of this text! "
var display_text;
var place;
var meter;
var out = " ";
var place = 50;
function scroll_text() {
for (meter = 0; meter < place; meter++) {
out += " "}
if (place >= 0)
out += display_text
else out = display_text.substring(-place,display_text.length)
document.scroll_form.field.value = out
out = " "
place--
if (place < -(display_text.length)) {
place = 50
}
setTimeout('scroll_text()',100)
}
// End -->
</SCRIPT>

Section 2 inbetween the <BODY> tags:

<CENTER>
<FORM NAME="scroll_form">
<input type="button" name="button_one" value="Start" onClick="scroll_text()">
<input type="text" name="field" size="50">
</FORM>
</CENTER>
<!-- Script Size: 1.30 KB -->

Don't forget to tell your readers to click on the button to see the latest news from your site, and good luck with learning more Javascript.


Software Sections
Chillisoft FaqsC++ Faqs
Java FaqsJava Glossary
VB FaqsHTML Tutorial
STP Centers 
Copyright AllIndianSite.com. All Rights Reserved.