3

I want to show the overlay over the div. After showing overlay i don't want to allow to select that background div. But when i double click on the over lay that background div is in selectable state. Can you please any one look into this. http://jsfiddle.net/fkWn5/2/

Bongs
  • 5,302
  • 4
  • 28
  • 49
Searcher
  • 1,805
  • 9
  • 31
  • 44

2 Answers2

2

Solution

You can do this by using the user select rules in css and adding this class to the background element once turning on the overlay:

css:

.unselectable { 
-moz-user-select: -moz-none;
   -khtml-user-select: none;
   -webkit-user-select: none;
   -ms-user-select: none;
   user-select: none;
}

adding the class with jquery:

$('#backgrounddiv').addClass('unselectable');

jsfiddle example:

References:

Community
  • 1
  • 1
Michael Zaporozhets
  • 20,406
  • 3
  • 27
  • 47
0
$(document).ready(function() {
    $('#search_name').on('keyup',
    function() {
        search_name = $(this).val();
        $("#names li:contains('" + search_name + "')").addClass('highlight').siblings().removeClass('highlight');
    });
});
thecodeparadox
  • 81,835
  • 21
  • 131
  • 160