Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Jul 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Javascript linking

    Hi,

    In my navigation on a website I am working on, I have a rollover navigation.

    This was a pre-made script. In the actual link, this is the code:

    Code:
    <a href="javascript:;" class="navText">forums</a>
    How would I like that? I had that it would be like the following, but that is how it is in CSS.

    Code:
    <a href="javascript:url('www.google.com';" class="navText">forums</a>
    Am I on the right track here?

    Thank you,

    xsx

    Edit-

    http://exiledknights.net/

    If I add that, it creates unwanted space. I tested it on the first button. I also tried simply putting the link. I'm not exactly sure what to do from here.
    Last edited by xsx43; 07-08-2007 at 02:26 AM. Reason: more information

  • #2
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,603
    Thanks
    0
    Thanked 645 Times in 635 Posts
    Get rid of the link and the JavaScript.

    <span class="navText">forums</span>
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #3
    New to the CF scene
    Join Date
    Jul 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Heh. I actually tried that, but, the thing was surrounded by <p>

    I saw it at the last minute. Pshh. Thanks =]

  • #4
    Senior Coder
    Join Date
    Feb 2003
    Posts
    1,665
    Thanks
    0
    Thanked 27 Times in 25 Posts
    Quote Originally Posted by felgall View Post
    Get rid of the link and the JavaScript.

    <span class="navText">forums</span>
    If the nav link is meant to be usable by keyboard users and AT users (why wouldn't it be?), this is not a good approach as the 'link' will not be able to receive the tab focus and will not be usable by those who aren't using a mouse or some other pointing device.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •