0

Hi I've made two little buttons which are divs with click event attached . Both of them of position:absolute and have the same z-index . The problem is when I double click on just the right button it selects the entire section below it . I've tried attaching a .dblclick(function(e) { e.preventDefault(); }); on the section, body and button , this didn't work .

Thanks in advance .

Infra Stank
  • 816
  • 2
  • 7
  • 17

1 Answers1

2

On your html / button

unselectable="on" class="unselectable"

CSS

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

unselectable="on" is for IE and Opera.

You might also wanna take a look here: unselectable Text and Tim Downs answer.

Community
  • 1
  • 1
SunnyRed
  • 3,525
  • 4
  • 36
  • 57