www.webdeveloper.com
Results 1 to 3 of 3

Thread: href 'return false' and hyperlink states

  1. #1
    Join Date
    Jun 2011
    Posts
    2

    href 'return false' and hyperlink states

    I have been charged with using CSS to change the visited state of a hyperlinks that use "return false" in the href to cancel the redirect.

    The CSS is simple, the other three states (L, H, A) render properly. The visited state will not.

    I am inclined to say that this task is impossible without more JS due to the fact that the click event is effectively cancelled to and the redirect.

    Can anyone here concur? Or, am I missing something obvious?

    Simple example:
    <a class="thumb" href="img/a.jpg" title="Day 1" onclick="showImg(this); return false;">

  2. #2
    Join Date
    Dec 2010
    Posts
    207
    Code:
    <a class="thumb" href="img/a.jpg" title="Day 1" onclick="showImg(this); this.className='visitedLink'; return false;">
    Where 'visitedLink' is a copy of 'thumb' except with different default attributes.

  3. #3
    Join Date
    Jun 2011
    Posts
    2

    resolved

    Brilliantly simple clueful... I appreciate your reply.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles