jetrodn
4/14/2016 - 6:45 PM

Selection on the page (enable/disable)

Selection on the page (enable/disable)

/*============================================
 Disable selection on the page
 ============================================*/
(function ($) {
    $.fn.disableSelection = function () {
        return this
            .attr('unselectable', 'on')
            .css('user-select', 'none')
            .on('selectstart', false);
    };
})(jQuery);

var isSelectionDisabled = false;
/* Set false for debugging mode */
if (isSelectionDisabled === true) {
    $('body').disableSelection();
}