Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Remove mouse highlighting ability on a page? Re: Remove mouse highlighting ability on a page?

#69345
jamygolden
Member
-moz-user-select: none;
-webkit-user-select: none;
user-select: none;

Gecko and Webkit are the only ones supporting it atm though.

Or

You could put an invisible div ontop of the text. Assuming this doesn’t have to be done in dynamic places.

Edit: Also, I came across this javascript example:

$.fn.disableSelection = function() {
$(this).attr('unselectable', 'on')
.css('-moz-user-select', 'none')
.each(function() {
this.onselectstart = function() { return false; };
});
};
$(document).ready(function(){
$('p').disableSelection();
});