Change link color-popup

Is there a way to change the link color to gray without the code glitching like at my site. (code glitches and says Quick Nav. )

Click here to see page with glitch

I only want that link to be bold not the other.

Heres the current code.

     <script type="text/javascript">
// Popup window code
function newPopup(url) {
    popupWindow = window.open(
        url,'popUpWindow','height=700,width=800,left=10,top=10,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no,status=yes')
}
</script>
<a style="text-decoration:none;" href="JavaScript:newPopup('<font color="gray">http://onlythebestoftheweb.x10.mx/navigation/quick.html</font>');">Quick Nav.</a>

Also just to let you know the page is supposed to be a 404 error, thats where the glitch is.

Answers


Since you're using CSS, you'd want to just take that link for the popup, give it a class name, and style the class name with the CSS.

Add these lines of CSS

CSS:
a.popup-link {
    color: grey;
    text-decoration: none;
}

Then change the link for the popup to the following:

HTML:
<a class="popup-link" href="JavaScript:newPopup('http://onlythebestoftheweb.x10.mx/navigation/quick.html');">Quick Nav.</a>

  1. For changing the link color to gray:

    CSS:

    a {
        color: #848484;
    }
    
  2. The reason your code is "glitching" is because of this line:

    <a style="text-decoration:none;" href="JavaScript:newPopup('<font color="gray">http://onlythebestoftheweb.x10.mx/navigation/quick.html</font>');">Quick Nav.</a>
    

    You need to escape double quotes within double quotes to make it work:

    <a style="text-decoration:none;" href="JavaScript:newPopup('<font color=\"gray\">http://onlythebestoftheweb.x10.mx/navigation/quick.html</font>');">Quick Nav.</a>
    

Here you go, this is a little cleaner practice.

http://jsfiddle.net/wkYJ5/3/

--

<script type="text/javascript">
    // Popup window code
    var newPopup = function () {

        if (this.style.color === 'green' || this.style.color==='') { this.style.color = 'red'; } else { this.style.color = 'green' };

        var popupWindow = window.open(
            this.url, 'popUpWindow', 'height=700,width=800,left=10,top=10,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no,status=yes');

        return false;
    };
    setTimeout(function () {

        var qnLk = document.getElementById('qnLk');
        qnLk.onclick = newPopup;
        qnLk.url = 'http://onlythebestoftheweb.x10.mx/navigation/quick.html';

    }, 100);
</script>

--

<a id="qnLk" style="text-decoration:none;color:green;" href="#">Quick Nav.</a>

Need Your Help

wdActiveEndPageNumber returns a negative number

vba word-vba

I'm trying to process headers based on the current page number in a Word macro:

R or Python for file manipulation

python file r performance

I have 4 reasonably complex r scripts that are used to manipulate csv and xml files. These were created by another department where they work exclusively in r.