Created
April 5, 2011 07:44
-
-
Save imakewebthings/903185 to your computer and use it in GitHub Desktop.
backgroundClip: text; revision for FF4?
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
Modernizr.addTest('backgroundcliptext',function(){ | |
var div = document.createElement('div'); | |
var bgClip = false; | |
if ('backgroundClip' in div.style) bgClip = true; | |
'Webkit Moz O ms Khtml'.replace(/([A-Za-z]*)/g, function(val) { | |
if (val+'BackgroundClip' in div.style) bgClip = true; | |
}); | |
if (bgClip) { | |
div.style.backgroundClip = 'text'; | |
if (div.style.backgroundClip === 'text') return true; | |
'Webkit Moz O ms Khtml'.replace(/([A-Za-z]*)/g, function(val) { | |
div.style[val+'BackgroundClip'] = 'text'; | |
if (div.style[val+'BackgroundClip'] === 'text') return true; | |
}); | |
} | |
return false; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment