-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgrid.js
More file actions
31 lines (29 loc) · 848 Bytes
/
grid.js
File metadata and controls
31 lines (29 loc) · 848 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
/*
Set all .grid__cell elements to be the same height as the parent.
This is used in-lieu of proper CSS support.
*/
if (
(document.all && document.querySelector) // IE8-10
|| (navigator.userAgent.indexOf('Opera Mini') > -1) // Opera Mini
|| (window.opera && window.opera.version() >= 12) // Opera >= 12
) {
function fix_height() {
// Reset height:
jQuery('.grid__cell').each(function(){
var $this = jQuery(this);
$this.height('auto');
});
// Fix height:
jQuery('.grid__cell').each(function(){
var $this = jQuery(this);
var h = $this.parent().height();
$this.height(h + 'px');
});
}
jQuery(function() {
fix_height();
});
jQuery(window).resize(function() {
fix_height();
});
}