Permalink
Browse files

Updated Box Reflect hook

  • Loading branch information...
1 parent 90aaa8b commit 2085c4a15e251b1d3098e5fb79a3198b1fdeb883 Tom Ellis committed Aug 18, 2011
Showing with 11 additions and 13 deletions.
  1. +11 −13 boxreflect.js
View
@@ -1,34 +1,32 @@
/*!
* Copyright (c) 2011 Tom Ellis (http://www.webmuse.co.uk)
-* User Select cssHook for jQuery
+* Box Reflect cssHook for jQuery
* Limitations:
- Works with jQuery 1.4.3 and higher
+ - Doesn't currently support gradients
* Licensed under the MIT License (LICENSE.txt).
*/
(function($) {
- // Css3 Box Reflect set and get hooks
var div = document.createElement('div'),
divStyle = div.style;
- $.support.boxReflect = divStyle.WebkitBoxReflect === '' ? 'WebkitBoxReflect' :
- (divStyle.MozBoxReflect === '' ? 'MozBoxReflect' :
- (divStyle.OBoxReflect === '' ? 'OBoxReflect' :
- (divStyle.boxReflect === '' ? 'boxReflect' : false)));
+
+ $.support.boxReflect =
+ divStyle.boxReflect === '' ? 'boxReflect' :
+ (divStyle.MozBoxReflect === '' ? 'MozBoxReflect' :
+ (divStyle.WebkitBoxReflect === '' ? 'WebkitBoxReflect' :
+ (divStyle.OBoxReflect === '' ? 'OBoxReflect' : false)));
- if ( $.support.boxReflect && $.support.boxReflect !== 'boxReflect' ){
+ if ( $.support.boxReflect && $.support.boxReflect !== 'boxReflect' ) {
- $.cssHooks.boxReflect = {
-
+ $.cssHooks.boxReflect = {
get: function( elem, computed, extra ) {
- //Need to add support for gradients
return $.css( elem, $.support.boxReflect );
},
set: function( elem, value ) {
- //Need to add support for gradients
elem.style[$.support.boxReflect] = value;
}
};
}
-
div = divStyle = null;
-
+
})(jQuery);

0 comments on commit 2085c4a

Please sign in to comment.