How do you glow ur links like that?

  • DarkAZNboi1313
  • Beginner
  • Beginner
  • DarkAZNboi1313
  • Posts: 39
  • Loc: Washington

Post 3+ Months Ago

So like the title says, how do i get links to glow a color like on this site? srry if this was already asked :oops:
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Carnix
  • Guru
  • Guru
  • User avatar
  • Posts: 1098

Post 3+ Months Ago

It's been asked a million times... Try using the search feature...

Someone should just add this question to the site's FAQ!

.c
  • SSH-Raj
  • Expert
  • Expert
  • User avatar
  • Posts: 588

Post 3+ Months Ago

here you go:

Code: [ Select ]
// This script will no longer overwrite your current onmouseover and
// onmouseout attributes - it will instead skip those links. If you would
// still like to fade them, add findLink(this.id) to your onmouseover
// and clearFade() to your onmouseout, like so -
// <a href="#" onmouseover="findLink(this.id); yourFunction()"
// onmouseout="clearFade(); yourSecondFunction()">
// Make sure to put it BEFORE any "return" statements otherwise
// the fade will not execute.

var fadeTo = "ff5555";

// Fade in colour increment/decrement by
var fiBy = 6;

// Fade out colour increment/decrement by
var foBy = 6;

// Speed - milliseconds between each colour change in the fade
// Less than 10ms doesn't really make all that much difference, so
// 10 is the minimum effective value.
var speed = 20;

// Class name of links to NOT fade (i.e. ignore)
// var ignoreClass = "somebogusvalue" if you don't want to
// use this feature. Alternatively, add onmouseover="clearFade()"
// to the link you do not wish to fade.
var ignoreClass = "ignore";

// No more changes required (unless you know what you are doing)
// Enjoy... and email me and let me know what site(s) you are using it on :)
var opera, ie, dom, x = 0, oc, fader, ocs = new Array();

if (navigator.userAgent.indexOf("Opera") != -1) opera = true
else if (document.all && !opera) ie = true
else if (!document.all && document.getElementById) dom = true;

function convertRGB(z)
    {
        var newfcS = "", splitter = "";
        splitter = z.split(",");
        splitter[0] = parseInt(splitter[0].substring(4, splitter[0].length));
        splitter[1] = parseInt(splitter[1]);
        splitter[2] = parseInt(splitter[2].substring(0, splitter[2].length-1));
        for (var q = 0; q < 3; q++)
            {
                splitter[q] = splitter[q].toString(16);
                if (splitter[q].length == 1) splitter[q] = "0" + splitter[q];
                newfcS += splitter[q];
            }
        return newfcS;
    }

function currentColour(index)
    {
        var temp, cc;
        if (opera) cc = document.links[index].style.color
        else if (ie) cc = document.links[index].currentStyle.color
        else if (dom) cc = document.defaultView.getComputedStyle(document.links[index], '').getPropertyValue("color");
        if (cc.length == 4 && cc.substring(0, 1) == "#")
            {
                temp = "";
                for (var a = 0; a < 3; a++)
                    temp += cc.substring(a+1, a+2) + cc.substring(a+1, a+2);
                cc = temp;
            }
        else if (cc.indexOf("rgb") != -1) cc = convertRGB(cc)
        else if (cc.length == 7) cc = cc.substring(1, 7)
        else cc = fadeTo;
        return cc;
    }


function convert2Dec(hex)
    {    
        var rgb = new Array();
        for (var u = 0; u < 3; u++)
            rgb[u] = parseInt(hex.substring(u*2, u*2+2), 16);
        return rgb;
    }

function newRGB(f, n, d)
    {
        var change;
        if (d == 1) change = fiBy
        else change = foBy;
        for (var g = 0; g < 3; g++)
            {
                if (n[g] > f[g] && n[g] - change >= 0) n[g] -= change;
                if (n[g] < f[g] && n[g] + change <= 255) n[g] += change;
            }
        return n;
    }

function fade(index, d)
    {
        var fc, nc, temp = new Array(), finished = false;
        nc = convert2Dec(currentColour(index));
        if (d == 1) fc = convert2Dec(fadeTo)
        else fc = convert2Dec(ocs[x]);
        temp = convert2Dec(currentColour(index));
        nc = newRGB(fc, nc, d);
        if ((nc[0] == temp[0]) && (nc[1] == temp[1]) && (nc[2] == temp[2]))
            finished = true;
        if (!finished) document.links[x].style.color = "rgb(" + nc[0] + "," + nc[1] + "," + nc[2] + ")"
        else clearInterval(fader);
    }

function findLink(over)
    {
        if (document.layers) return;
        if (fader)
            {
                clearInterval(fader);
                document.links[x].style.color = "#" + ocs[x];
            }
        if (over && !this.id) this.id = over;
        x = 0;
        while (!(this.id == document.links[x].id) && (x < document.links.length))
            x++;
        if (this.id == document.links[x].id)
            {
                oc = currentColour(x);
                fader = setInterval("fade(" + x + ", 1)", speed);
            }
    }

function clearFade()
    {
        if (document.layers) return;
        if (fader) clearInterval(fader);
        fader = setInterval("fade(" + x + ", 0)", speed);
    }

function init()
    {
        for (var i = 0; i < document.links.length; i++)
            {
                ocs[i] = currentColour(i);
                var currentOver = document.links[i].onmouseover;
                var currentOut = document.links[i].onmouseout;
                var ignoreIt = document.links[i].className == ignoreClass;
                if (!ignoreIt) document.links[i].id = "link" + i;
                if (!currentOver && !currentOut && !ignoreIt)
                    {
                        document.links[i].onmouseover = findLink;
                        document.links[i].onmouseout = clearFade;
                    }
            }        
}

if (opera || ie || dom) window.onload = init;
  1. // This script will no longer overwrite your current onmouseover and
  2. // onmouseout attributes - it will instead skip those links. If you would
  3. // still like to fade them, add findLink(this.id) to your onmouseover
  4. // and clearFade() to your onmouseout, like so -
  5. // <a href="#" onmouseover="findLink(this.id); yourFunction()"
  6. // onmouseout="clearFade(); yourSecondFunction()">
  7. // Make sure to put it BEFORE any "return" statements otherwise
  8. // the fade will not execute.
  9. var fadeTo = "ff5555";
  10. // Fade in colour increment/decrement by
  11. var fiBy = 6;
  12. // Fade out colour increment/decrement by
  13. var foBy = 6;
  14. // Speed - milliseconds between each colour change in the fade
  15. // Less than 10ms doesn't really make all that much difference, so
  16. // 10 is the minimum effective value.
  17. var speed = 20;
  18. // Class name of links to NOT fade (i.e. ignore)
  19. // var ignoreClass = "somebogusvalue" if you don't want to
  20. // use this feature. Alternatively, add onmouseover="clearFade()"
  21. // to the link you do not wish to fade.
  22. var ignoreClass = "ignore";
  23. // No more changes required (unless you know what you are doing)
  24. // Enjoy... and email me and let me know what site(s) you are using it on :)
  25. var opera, ie, dom, x = 0, oc, fader, ocs = new Array();
  26. if (navigator.userAgent.indexOf("Opera") != -1) opera = true
  27. else if (document.all && !opera) ie = true
  28. else if (!document.all && document.getElementById) dom = true;
  29. function convertRGB(z)
  30.     {
  31.         var newfcS = "", splitter = "";
  32.         splitter = z.split(",");
  33.         splitter[0] = parseInt(splitter[0].substring(4, splitter[0].length));
  34.         splitter[1] = parseInt(splitter[1]);
  35.         splitter[2] = parseInt(splitter[2].substring(0, splitter[2].length-1));
  36.         for (var q = 0; q < 3; q++)
  37.             {
  38.                 splitter[q] = splitter[q].toString(16);
  39.                 if (splitter[q].length == 1) splitter[q] = "0" + splitter[q];
  40.                 newfcS += splitter[q];
  41.             }
  42.         return newfcS;
  43.     }
  44. function currentColour(index)
  45.     {
  46.         var temp, cc;
  47.         if (opera) cc = document.links[index].style.color
  48.         else if (ie) cc = document.links[index].currentStyle.color
  49.         else if (dom) cc = document.defaultView.getComputedStyle(document.links[index], '').getPropertyValue("color");
  50.         if (cc.length == 4 && cc.substring(0, 1) == "#")
  51.             {
  52.                 temp = "";
  53.                 for (var a = 0; a < 3; a++)
  54.                     temp += cc.substring(a+1, a+2) + cc.substring(a+1, a+2);
  55.                 cc = temp;
  56.             }
  57.         else if (cc.indexOf("rgb") != -1) cc = convertRGB(cc)
  58.         else if (cc.length == 7) cc = cc.substring(1, 7)
  59.         else cc = fadeTo;
  60.         return cc;
  61.     }
  62. function convert2Dec(hex)
  63.     {    
  64.         var rgb = new Array();
  65.         for (var u = 0; u < 3; u++)
  66.             rgb[u] = parseInt(hex.substring(u*2, u*2+2), 16);
  67.         return rgb;
  68.     }
  69. function newRGB(f, n, d)
  70.     {
  71.         var change;
  72.         if (d == 1) change = fiBy
  73.         else change = foBy;
  74.         for (var g = 0; g < 3; g++)
  75.             {
  76.                 if (n[g] > f[g] && n[g] - change >= 0) n[g] -= change;
  77.                 if (n[g] < f[g] && n[g] + change <= 255) n[g] += change;
  78.             }
  79.         return n;
  80.     }
  81. function fade(index, d)
  82.     {
  83.         var fc, nc, temp = new Array(), finished = false;
  84.         nc = convert2Dec(currentColour(index));
  85.         if (d == 1) fc = convert2Dec(fadeTo)
  86.         else fc = convert2Dec(ocs[x]);
  87.         temp = convert2Dec(currentColour(index));
  88.         nc = newRGB(fc, nc, d);
  89.         if ((nc[0] == temp[0]) && (nc[1] == temp[1]) && (nc[2] == temp[2]))
  90.             finished = true;
  91.         if (!finished) document.links[x].style.color = "rgb(" + nc[0] + "," + nc[1] + "," + nc[2] + ")"
  92.         else clearInterval(fader);
  93.     }
  94. function findLink(over)
  95.     {
  96.         if (document.layers) return;
  97.         if (fader)
  98.             {
  99.                 clearInterval(fader);
  100.                 document.links[x].style.color = "#" + ocs[x];
  101.             }
  102.         if (over && !this.id) this.id = over;
  103.         x = 0;
  104.         while (!(this.id == document.links[x].id) && (x < document.links.length))
  105.             x++;
  106.         if (this.id == document.links[x].id)
  107.             {
  108.                 oc = currentColour(x);
  109.                 fader = setInterval("fade(" + x + ", 1)", speed);
  110.             }
  111.     }
  112. function clearFade()
  113.     {
  114.         if (document.layers) return;
  115.         if (fader) clearInterval(fader);
  116.         fader = setInterval("fade(" + x + ", 0)", speed);
  117.     }
  118. function init()
  119.     {
  120.         for (var i = 0; i < document.links.length; i++)
  121.             {
  122.                 ocs[i] = currentColour(i);
  123.                 var currentOver = document.links[i].onmouseover;
  124.                 var currentOut = document.links[i].onmouseout;
  125.                 var ignoreIt = document.links[i].className == ignoreClass;
  126.                 if (!ignoreIt) document.links[i].id = "link" + i;
  127.                 if (!currentOver && !currentOut && !ignoreIt)
  128.                     {
  129.                         document.links[i].onmouseover = findLink;
  130.                         document.links[i].onmouseout = clearFade;
  131.                     }
  132.             }        
  133. }
  134. if (opera || ie || dom) window.onload = init;
  • UNFLUX
  • Genius
  • Genius
  • User avatar
  • Posts: 6376
  • Loc: twitter.com/unflux

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: ScottG and 58 guests
  • 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 post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.