Jump to content
xisto Community
Sign in to follow this  
noxit

Glowing text on mouseover... java scripting ..

Recommended Posts

One more script for today ... B)

The text glows on mouseover of the page which will draw the eyes of your visitor. Good to use on important lines of text that you want noticed.

The colors can be changed easily to blend in with your background color, as can be the font style and size.

 

Installation:

 

STEP 1:

 

Copy the code below and paste this into the <head> of your html document. Comments have been inserted where you change the text size, type and colors at the top part of the script.

 

CODEstarts

 

<script>

// Change your message here!

var message="Move your mouse!"

 

// The font of your message

var textfont="Verdana"

 

// The fontsize of your message

var textsize=15

 

// the fontcolor of your message

var textcolor="red"

 

// the color of the gloweffect

var glowcolor="blue"

 

 

//Do not edit the variables below

var glowstrength=0

var x,y

 

 

function handlerMM(e){

x = (document.layers) ? e.pageX : event.clientX

y = (document.layers) ? e.pageY : event.clientY

}

 

function initiate() {

if (document.all) {

document.onmousemove = handlerMM;

glowmessage()

}

if (document.layers) {

document.onmousemove = handlerMM;

document.captureEvents(Event.MOUSEMOVE);

textsize=10

glowmessage()

}

}

 

function glowmessage() {

if(document.all) {

glowstrength=Math.round(x/80)+Math.round(y/80)

glowtext.innerHTML="<span id='glowspan' style='position:absolute;filter:glow(strength="+glowstrength+",color="+glowcolor+");font-family:"+textfont+";font-size:"+textsize+"pt;color:"+textcolor+"'>"+message+"</span>";

var timer=setTimeout("glowmessage()",100)

}

if(document.layers) {

textsize=3*Math.round(x/80)+3*Math.round(y/80)

document.glowtext.document.write("<span id='glowspan' style='position:absolute;font-family:"+textfont+";font-size:"+textsize+"pt;color:"+textcolor+"'>"+message+"</span>")

document.glowtext.document.close()

var timer=setTimeout("glowmessage()",100)

}

}

 

// - - -->

</script>

 

CODEends

 

STEP 2:

 

Place the event handler directly into the <body> tag. Your body tag should look something like this. <body bgcolor="#FFFFFF" onLoad="initiate()">

 

CODEstarts

 

onLoad="initiate()"

 

CODEends

 

STEP 3:

 

Copy and paste the code below between the <body> and </body> tags. You change the position where you want the glow text to appear on your page by altering the positioning alignment in "top" and "left".

(Top signifies in pixels how far from the top of the page the text will be displayed. Left signifies in pixels how far from the left side of the page the text will be displayed. You may have to play around with this positioning to get it right for you.)

 

Codestarts

 

<div id="glowtext" style="position:absolute;top:300px;left:20px"></div>

 

 

codeEnds

 

Goah am tired now...this is enufff for today .. :P

Share this post


Link to post
Share on other sites

I think you forgot to put semicolons.. BTW, R u posting for CASH or for HOSTING... These tutorials will earn u nice cash .. i guess. While applying for hosting won't do .. B)

Share this post


Link to post
Share on other sites
B) ..Sorrry but theres no pace where uve mentioned abt not copying tutorials ..are only self made tutorials alloweD?? And there is always some place wheere you get things from ...and 99.99% chnce is some other website .. :P ..

Share this post


Link to post
Share on other sites

If you check out the link, the posts are 1:1. We understand coincidence, after all we are humans sitting at this end.. watching at the forums. And we have clearly mentioned in out pinned posts that COPIED STUFF AINT ALLOWED AT ALL!Be carefull next time. B)

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.