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 5 of 5
  1. #1
    New Coder
    Join Date
    Apr 2007
    Posts
    72
    Thanks
    4
    Thanked 0 Times in 0 Posts

    link diactivation

    Hello to all:

    I tried to search for my question, but only 'right-click' disactivation came up. This is NOT my question. What I'm trying to do is have a link act as a link (using underline, color change, etc.) without actually linking to a page. My codes for the appearance of the links work fine. Is this possible? Or should I have the link actually link to somewhere. Any suggestions?

    Thanks so much,
    DS67

  • #2
    New Coder
    Join Date
    Apr 2006
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Why don't you link to the same page then?

  • #3
    Regular Coder
    Join Date
    Feb 2005
    Posts
    679
    Thanks
    0
    Thanked 16 Times in 15 Posts
    You could manipulate the CSS
    Code:
    <span id="faux" style="border-bottom: 1px solid;color: #0000ff;" onmouseover="this.style.color='#ff0000'" onmouseout="this.style.color='#0000ff'">Text</span>
    or a link
    Code:
    <a href="#" title="" onclick="return false">Text</a>

  • #4
    New Coder
    Join Date
    Apr 2007
    Posts
    72
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Thanks rwedge! the <a href="#" title="" onclick="return false">Text</a> worked perfect. You knew exactly what I was looking for.

  • #5
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Location
    Splendora, Texas, United States of America
    Posts
    3,387
    Thanks
    32
    Thanked 288 Times in 282 Posts
    Quote Originally Posted by ds67 View Post
    Thanks rwedge! the <a href="#" title="" onclick="return false">Text</a> worked perfect. You knew exactly what I was looking for.
    I’m pretty sure that “#” is not a valid URI. The problem with this is that the link is broken in situations where JavaScript is missing from the picture and that it’s not really a link since it doesn’t go anywhere. You also tend to get a meaningless URI in the status bar when hovering over the anchor element.

    You can easily style something to look like a hyperlink:

    Code:
    .hyperlink { color: blue; text-decoration: underline; cursor: pointer; }
    The main drawbacks are (A) that the link will not be colored according to the user’s default link colors and (B) that the author will have to define hover effects in JavaScript due to Internet Explorer 6’s incomplete support for the :hover pseudo‐class. (A) is generally a non‐issue though since, if you define any background colors, then you should be defining link text colors anyway. (B) can be dealt with if you know how to write JavaScript or is a non‐issue if you don’t need hover effects or don’t need IE6 support.
    For every complex problem, there is an answer that is clear, simple, and wrong.


  •  

    Posting Permissions

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