Skip to content

Instantly share code, notes, and snippets.

@imakewebthings
Created April 5, 2011 07:44
Show Gist options
  • Save imakewebthings/903185 to your computer and use it in GitHub Desktop.
Save imakewebthings/903185 to your computer and use it in GitHub Desktop.
backgroundClip: text; revision for FF4?
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