Jump to content

Javascript Mouse Over Fade...


p8baller07

Recommended Posts

Well a customer asked me to make this script, so here it is... i thought id post it incase anyone ever needed it. it fades links... pop it in the head tag of your page and try it.

 

demohere

 

If you change autofade to false you need to add class="fade" in every href tag...

and dont put anything inside href tag besides the name...

 

 

Example of what not to do

<a href="url.html"><b>test</b></a>

 

ok here is the code guys

 

 

<script language="Javascript">

// This was made by aimen shawki please leave this in here...thanks

// --------this is the stuff you can change-----------------

//=======================================================================

startColor = "#ffffff"; // MouseOut link color -right now its white

endColor = "#000000"; // MouseOver link color -right now its black

stepIn = 17; // delay when fading in

stepOut = 25; // delay when fading out

autoFade = true;

sloppyClass = false;

//========================================================================

 

hexa = new makearray(16);

for(var i = 0; i < 10; i++)

hexa[i] = i;

hexa[10]="a"; hexa[11]="b"; hexa[12]="c";

hexa[13]="d"; hexa[14]="e"; hexa[15]="f";

 

var version = parseInt(navigator.appVersion)

var appName = navigator.appName

var ns4 = version>=4 && appName=="Netscape"

 

if (ns4) { //Netscape 4+

document.onmouseover = doN4mouseover;

document.onmouseout = doN4mouseout;

} else { //other

document.onmouseover= domouseover;

document.onmouseout= domouseout;

}

 

startColor = dehexize(startColor.toLowerCase());

endColor = dehexize(endColor.toLowerCase());

var fadeId = new Array();

 

function dehexize(Color){

var colorArr = new makearray(3);

for (i=1; i<7; i++){

 

Share this post


Link to post
Share on other sites

ohh well weird.. it looks identical to the Fade Script by Anarchos: http://www.phpbb.com/phpBB/viewtopic.php?t...tart=40#1021178 even down to the comments made.

pffft yeah-well.... like i said i took some variables from other code i found to help me out cuz i had problems with "if the fade is already there" part

Share this post


Link to post
Share on other sites

I still think it's a good script :) I'll have to keep it in mind, might come in handy.

thanks linux :)... btw i wanted to know who does the web work here? i always wanted to talk to him/her, they must have talent, to make certain things work (folding icon for folders and code for case gallery.

Share this post


Link to post
Share on other sites

thanks linux :)... btw i wanted to know who does the web work here? i always wanted to talk to him/her, they must have talent, to make certain things work (folding icon for folders and code for case gallery.

I do it all :)

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...