forked from brandonaaron/jquery-cssHooks
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathboxshadow.js
More file actions
65 lines (54 loc) · 2.01 KB
/
Copy pathboxshadow.js
File metadata and controls
65 lines (54 loc) · 2.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*! Copyright (c) 2010 Burin Asavesna (http://helloburin.com)
* Licensed under the MIT License (LICENSE.txt).
*/
(function($) {
// boxShadow get hooks
var div = document.createElement('div'),
divStyle = div.style,
support = $.support;
support.boxShadow =
divStyle.MozBoxShadow === ''? 'MozBoxShadow' :
(divStyle.MsBoxShadow === ''? 'MsBoxShadow' :
(divStyle.WebkitBoxShadow === ''? 'WebkitBoxShadow' :
(divStyle.OBoxShadow === ''? 'OBoxShadow' :
(divStyle.BoxShadow === ''? 'BoxShadow' :
false))));
if ($.support.boxShadow) {
$.cssHooks.boxShadow = {
get: function( elem, computed, extra ) {
return $.css(elem, support.boxShadow);
},
set: function( elem, value ) {
elem.style[ support.boxShadow ] = value;
}
};
$.cssHooks.boxShadowColor = {
get: function ( elem, computed, extra ) {
return $.css(elem, support.boxShadow).split(/\)\s/)[0] + ')';
},
set: function( elem, value ) {
elem.style[ support.boxShadow ] = value + " " + $.css(elem, support.boxShadow).split(/\)\s/)[1];
}
};
$.cssHooks.boxShadowBlur = {
get: function ( elem, computed, extra ) {
return $.css(elem, support.boxShadow).split(/\s/)[5];
}
};
$.cssHooks.boxShadowSpread = {
get: function ( elem, computed, extra ) {
return $.css(elem, support.boxShadow).split(/\s/)[6];
}
};
$.cssHooks.boxShadowX = {
get: function ( elem, computed, extra ) {
return $.css(elem, support.boxShadow).split(/\s/)[3];
}
};
$.cssHooks.boxShadowY = {
get: function ( elem, computed, extra ) {
return $.css(elem, support.boxShadow).split(/\s/)[4];
}
};
}
})(jQuery);