top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How not to allow a selection of any text from my website?

+1 vote
395 views
How not to allow a selection of any text from my website?
posted Jun 27, 2014 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

There are two ways which I can think of one using the CSS and other using JQuery -

CSS Way

body { // This will take care of most of the browsers 
  -webkit-user-select: none;
     -moz-user-select: -moz-none;
      -ms-user-select: none;
          user-select: none;
}

JQuery Way

(function($)
{
       $.fn.disableSelection = function() {
                          return this .attr('unselectable', 'on')
                                         .css('user-select', 'none')
                                         .on('selectstart', false);
                          }

})(jQuery);
answer Jun 28, 2014 by Salil Agrawal
Similar Questions
+3 votes

How to provide a facebook icon on my website, which will link to my facebook page when someone clicks on it. same question for google+ profile.

+1 vote

I've been doing some research on frameworks, etc. Everyone has one they like and even the development environments that you can get have their favorites and books seem to have their favorites. I've been looking at Cake, Symfony, Zend, PEAR-Flexy, Smarty, Joomla, etc., etc., etc. I'm not going to ask which framework everyone likes best because that's pointless.

All of the web hosting control panels/billing systems do not support the technologies that I'm currently using (dbmail, powerdns). To that end, I need to write my own. Should I be using a framework at all?

+9 votes

I dont want to disable the javascript but want to select the text from a restricted website. How can I achieve the same?

+3 votes

which software (html/css/js..etc etc) is required to create website like www.livebooks.com or Photoshelter.com (DIY: do it yourself).
for Frontend and backend both??

...