forked from brandonaaron/jquery-cssHooks
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathboxsizing.js
More file actions
executable file
·33 lines (27 loc) · 855 Bytes
/
boxsizing.js
File metadata and controls
executable file
·33 lines (27 loc) · 855 Bytes
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
/*!
* Copyright (c) 2011 Tom Ellis (http://www.webmuse.co.uk)
* Box Sizing cssHook for jQuery
* Limitations:
- Works with jQuery 1.4.3 and higher
* Licensed under the MIT License (LICENSE.txt).
*/
(function($) {
var div = document.createElement("div"),
divStyle = div.style;
$.support.boxSizing =
divStyle.boxSizing === ''? 'boxSizing' :
(divStyle.MozBoxSizing === ''? 'MozBoxSizing' :
(divStyle.WebkitBoxSizing === ''? 'WebkitBoxSizing' :
(divStyle.MsBoxSizing === ''? 'msBoxSizing' : false)));
if ( $.support.boxSizing && $.support.boxSizing !== "boxSizing" ){
$.cssHooks.boxSizing = {
get: function( elem, computed, extra ) {
return $.css(elem, $.support.boxSizing);
},
set: function( elem, value ) {
elem.style[ $.support.boxSizing ] = value;
}
};
}
div = divStyle = null;
})(jQuery);