Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Browsers don't take well to content changing on the <code>:active</code> event. Even if it did work, a CSS-only solution would likely mean that the user wouldn't even see the change in content before the new page had loaded (or started to load with a white screen). I tested a lot with the <code>:after</code> pseudo-selector and the <code>content</code> property, but this didn't work either.</p> <p>And rightly so. Changes to content should <em>only</em> be done with a language like Javascript. This is a logic issue and is outside of the scope of a styling language. Therefore, I would suggest using Javascript.</p> <p>I've created a quick <a href="http://jsfiddle.net/zryAT/3/" rel="nofollow"><strong><em>fiddle here</em></strong></a> using Javascript with jQuery (doesn't need jQuery it but it's easier) to switch the text in the link and then go to the new page exactly 1 second afterwards. This way you only need to have the original link in the HTML rather than hiding separate links with CSS. There are more flexible and extensible ways to do this if it's not just for one or two links but for the sake of an example, take a look at the fiddle.</p> <p>This is the jQuery:</p> <pre><code>$(".switch-link").click(function(){ $(this).text("Test Two"); var href = $(this).attr('href'); setTimeout(function(){ window.location = href }, 1000); return false; }); </code></pre> <p><code>1000</code> is the delay between the text changing and the browser starting to load the new page, you can change this to suit your needs.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload