forked from brandonaaron/jquery-cssHooks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathborderimage.js
executable file
·32 lines (27 loc) · 1003 Bytes
/
borderimage.js
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
/*!
* Copyright (c) 2011 Tom Ellis (http://www.webmuse.co.uk)
* Border Image cssHook for jQuery
* Limitations:
- Works with jQuery 1.4.3 and higher
- Doesn't work in all CSS3 browers (currently)
* Licensed under the MIT License (LICENSE.txt).
*/
(function($) {
var div = document.createElement( "div" ),
divStyle = div.style;
$.support.borderImage =
divStyle.borderImage === '' ? 'borderImage' :
(divStyle.MozBorderImage === '' ? 'MozBorderImage' :
(divStyle.WebkitBorderImage === '' ? 'WebkitBorderImage' : false));
if ( $.support.borderImage && $.support.borderImage !== "borderImage" ) {
$.cssHooks.borderImage = {
get: function( elem, computed, extra ) {
return $.css(elem, $.support.borderImage);
},
set: function( elem, value ) {
elem.style[$.support.borderImage] = value;
}
};
}
div = divStyle = null;
})(jQuery)