Created
November 29, 2012 15:22
-
-
Save bryanforbes/4169762 to your computer and use it in GitHub Desktop.
css-user-select
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
has.add("css-user-select", function(global, doc, element){ | |
var style = element.style; | |
if(typeof style.userSelect !== "undefined"){ | |
// Unlikely; user-select is non-standard, but might as well be future-proof... | |
return "userSelect"; | |
} | |
var prefixes = ["Khtml", "O", "ms", "Moz", "Webkit"], | |
i = prefixes.length, | |
prefix, name; | |
while(prefix = prefixes[--i]){ | |
if(style[(name = prefix + "UserSelect")] !== undefined){ | |
// Supported w/ vendor prefix; return whole name | |
return name; | |
} | |
} | |
return false; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment