Back in 2005 I wrote a popular Javascript snippet that disabled text selection on a page - today I've rewritten it for modern browsers so that it doesn't disable both selection of text AND buttons/links (haha).
mouseDown
event, waits 250 milliseconds and if there hasn't been a mouseUp
event yet, then selects a blank (and hidden) select box - thus cancelling the current selection.Anyway, feel free to check it out here:
http://lab.bandit.co.nz/scripts/disableselect/bandit-disable-select.js
Simply copy the following into the <head> tags of your page:
<script type="text/javascript" language="javascript" src="http://lab.bandit.co.nz/scripts/disableselect/bandit-disable-select.js"></script>
Try to select any text in the box below to see it in action...
You may link directly to my files but I don't recommend it. Upload them to your own server and go from there. Cheers!
-- James Nisbet from Bandit Design