You are missing our premiere tool bar navigation system! Register and use it for FREE!

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 113 guest(s) and 0 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - Fading links [ ]
 Forum FAQ  •  Search  •   •  Memberlist  •  Usergroups   •  Register  •  Profile •    •  Log in to check your private messages  •  Log in

 
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
Author Message
Mexx
Nuke Cadet
Nuke Cadet


Joined: Aug 14, 2003
Posts: 6


PostPosted: Sun Aug 17, 2003 2:02 pm Reply with quoteBack to top

Hi!

Can somebody help me and tell me how to make fading links on my PHP-Nuke powered site? I have seen it on various websites, but I canīt find the add-on or code anywhere! This is such a site with the fading links:

http://mtechnik.net/php/index.php

Thanx in advance! Smile

Greetz from the Netherlands, Max

_________________
"Flying isnīt dangerous, crashing is dangerous!"
Find all posts by MexxView user's profileSend private messageVisit poster's website
ladysilver
Lieutenant
Lieutenant


Joined: Apr 07, 2003
Posts: 278

Location: USA

PostPosted: Sun Aug 17, 2003 9:32 pm Reply with quoteBack to top

I haven't looked at the site, but it is probably done in javascript. You will need to download fade.js. Type it into Google and you should get a bunch of locations where you can download it. Install it in your /includes folder and add <script src="script_files/fade.js" language="Javascript"></script>
to my_header.php (also in /includes).

You will have to edit fade.js for your colors.
Find all posts by ladysilverView user's profileSend private messageSend e-mailVisit poster's websiteICQ Number
poppafrog
Lieutenant
Lieutenant


Joined: Jul 14, 2003
Posts: 153


PostPosted: Sun Aug 17, 2003 11:55 pm Reply with quoteBack to top

I inserted

<script src="script_files/fade.js" language="Javascript"></script>

in my_header.php in the following ways:

1 - <script src="script_files/fade.js" language="Javascript"></script>

2 - <script src="fade.js" language="Javascript"></script>

3 - <script src="scripts/fade.js" language="Javascript"></script>

4 - <script src="/scripts/fade.js" language="Javascript"></script>

and

5 - <script language="JavaScript" src="fade.js"></script>

with and without the ; but keep getting the following Parse error:

parse error in /home/public_html/includes/my_header.php on line 24

What am I not doing that is causing this error? Embarassed
Find all posts by poppafrogView user's profileSend private messageVisit poster's website
ladysilver
Lieutenant
Lieutenant


Joined: Apr 07, 2003
Posts: 278

Location: USA

PostPosted: Mon Aug 18, 2003 2:34 am Reply with quoteBack to top

The fault is mine. Embarassed I gave you the code without giving you any explanation of how to use it. In your my_header.php, format the fade instructions this way:

echo"<script language=\"JavaScript\" src=\"fade.js\"></script>\n";

Also put fade.js into any directory where you want to use the fade command. For your index, it needs to be in the same directory as index.php.

I set it up at one of my development sites here: http://www.sablemoon.com. You should be able to mouseover and see the links fade. Smile


Last edited by ladysilver on Mon Aug 18, 2003 10:29 am; edited 1 time in total
Find all posts by ladysilverView user's profileSend private messageSend e-mailVisit poster's websiteICQ Number
poppafrog
Lieutenant
Lieutenant


Joined: Jul 14, 2003
Posts: 153


PostPosted: Mon Aug 18, 2003 3:54 am Reply with quoteBack to top

Not a problem.

I saw another thread about this and the person put it in the header.php like:

Quote:
include("themes/$ThemeSel/theme.php");
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n";
echo "<script type=\"text/javascript\" language=\"JavaScript\" src=\"modules/Forums/fade.js\"></script>\n\n\n"; echo "<html>\n";


Is this safe? The reason I ask is, I saw another topic, that is now gone stating it wasn't too safe. Perhaps I misunderstood the response.
Find all posts by poppafrogView user's profileSend private messageVisit poster's website
Mexx
Nuke Cadet
Nuke Cadet


Joined: Aug 14, 2003
Posts: 6


PostPosted: Tue Aug 19, 2003 1:26 pm Reply with quoteBack to top

Thank you very much, this is just what I am looking for!! Iīll go try it after I solved a new problem I encountered, I canīt change the theme anymore. But thatīs another problem for an other topic so I wonīt bother you with that.

Thanx!!!
Very Happy

_________________
"Flying isnīt dangerous, crashing is dangerous!"
Find all posts by MexxView user's profileSend private messageVisit poster's website
Mexx
Nuke Cadet
Nuke Cadet


Joined: Aug 14, 2003
Posts: 6


PostPosted: Wed Aug 20, 2003 2:42 am Reply with quoteBack to top

I paste this in includes/my_header.php:
echo"<script language=\"JavaScript\" src=\"fade.js\"></script>\n";

Then I saved this code as fade.js and upload it into the main folder (where the index.php, config.php, header.php, footer.php, etc. is located).

Code:
/*************
**** <config>
**/
startColor = "#006699"; // MouseOut link color
endColor = "#FF6600"; // MouseOver link color

stepIn = 15; // delay when fading in
stepOut = 20; // delay when fading out

/*
** set to true or false; true will
** cause all links to fade automatically
***/
autoFade = true;
/*
** set to true or false; true will cause all CSS
** classes with "fade" in them to fade onmouseover
***/
sloppyClass = true;
/**
**** </config>
**************/
/*************
**** <install>
**
**
**** </install>
**************/

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";

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++){
for (j=0; j<16; j++){
if (Color.charAt(i) == hexa[j]){
if (i%2 !=0)
colorArr[Math.floor((i-1)/2)]=eval(j)*16;
else
colorArr[Math.floor((i-1)/2)]+=eval(j);
}
}
}
return colorArr;
}

function domouseover() {
if(document.all){
var srcElement = event.srcElement;
if ((srcElement.tagName == "A" && autoFade) || srcElement.className == "fade" || (sloppyClass && srcElement.className.indexOf("fade") != -1))
fade(startColor,endColor,srcElement.uniqueID,stepIn);
}
}

function domouseout() {
if (document.all){
var srcElement = event.srcElement;
if ((srcElement.tagName == "A" && autoFade) || srcElement.className == "fade" || (sloppyClass && srcElement.className.indexOf("fade") != -1))
fade(endColor,startColor,srcElement.uniqueID,stepOut);
}
}

function makearray(n) {
this.length = n;
for(var i = 1; i <= n; i++)
this[i] = 0;
return this;
}

function hex(i) {
if (i < 0)
return "00";
else if (i > 255)
return "ff";
else
return "" + hexa[Math.floor(i/16)] + hexa[i%16];}

function setColor(r, g, b, element) {
var hr = hex(r); var hg = hex(g); var hb = hex(b);
element.style.color = "#"+hr+hg+hb;
}

function fade(s,e, element,step){
var sr = s[0]; var sg = s[1]; var sb = s[2];
var er = e[0]; var eg = e[1]; var eb = e[2];

if (fadeId[0] != null && fade[0] != element){
setColor(sr,sg,sb,eval(fadeId[0]));
var i = 1;
while(i < fadeId.length){
clearTimeout(fadeId[i]);
i++;
}
}

for(var i = 0; i <= step; i++) {
fadeId[i+1] = setTimeout("setColor(Math.floor(" +sr+ " *(( " +step+ " - " +i+ " )/ " +step+ " ) + " +er+ " * (" +i+ "/" +
step+ ")),Math.floor(" +sg+ " * (( " +step+ " - " +i+ " )/ " +step+ " ) + " +eg+ " * (" +i+ "/" +step+
")),Math.floor(" +sb+ " * ((" +step+ "-" +i+ ")/" +step+ ") + " +eb+ " * (" +i+ "/" +step+ ")),"+element+");",i*step);
}
fadeId[0] = element;
}


Thanx guys! Very Happy

_________________
"Flying isnīt dangerous, crashing is dangerous!"

Last edited by Mexx on Wed Aug 20, 2003 3:16 am; edited 1 time in total
Find all posts by MexxView user's profileSend private messageVisit poster's website
Display posts from previous:      
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001, 2005 phpBB Group

Ported by Nuke Cops © 2003 www.nukecops.com
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::
Powered by TOGETHER TEAM srl ITALY http://www.togetherteam.it - DONDELEO E-COMMERCE http://www.DonDeLeo.com - TUTTISU E-COMMERCE http://www.tuttisu.it
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.049 Seconds - 110 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::