},
disableSelection: function() {
- return this.bind(
- "mousedown.ui-disableSelection selectstart.ui-disableSelection",
- function( event ) {
+ return this.bind( $.support.selectstart ? "selectstart" : "mousedown" +
+ ".ui-disableSelection", function( event ) {
event.preventDefault();
});
},
// support
$(function() {
- var div = document.createElement( "div" ),
- body = document.body;
+ var body = document.body,
+ div = body.appendChild( div = document.createElement( "div" ) );
$.extend( div.style, {
minHeight: "100px",
borderWidth: 0
});
- $.support.minHeight = body.appendChild( div ).offsetHeight === 100;
+ $.support.minHeight = div.offsetHeight === 100;
+ $.support.selectstart = "onselectstart" in div;
+
// set display to none to avoid a layout bug in IE
// http://dev.jquery.com/ticket/4014
body.removeChild( div ).style.display = "none";