forked from johnpolacek/stacktable.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstacktable.js
More file actions
43 lines (38 loc) · 1.27 KB
/
Copy pathstacktable.js
File metadata and controls
43 lines (38 loc) · 1.27 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
/**
* stacktable.js
* Author & copyright (c) 2012: John Polacek
* Dual MIT & GPL license
*
* Page: http://johnpolacek.github.com/stacktable.js
* Repo: https://github.com/johnpolacek/stacktable.js/
*
* The jQuery plugin for stacking tables for small screens in Responsive Web Design
*
*/
console.log('wtf');
;(function($) {
$.fn.stacktable = function(options) {
var $table = this,
$stacktable = $('<table></table>'),
reset = false,
equalize,
type;
if (!$.isFunction($.fn[stacktable])) { return false; }
return $table.each(function() {
$(this).find('tr').first().find('td,th')(function() {
$stacktable.append($('<tr>'+$(this).html()+'</tr>'));
});
$(this).before($stacktable);
// var $children = $(this).children(),
// max = 0; // reset for each container
// $children.each(function() {
// var $element = $(this),
// value;
// if (reset) { $element.css(type, ''); } // remove existing height/width dimension
// value = $element[equalize](); // call height(), outerHeight(), etc.
// if (value > max) { max = value; } // update max
// });
// $children.css(type, max +'px'); // add CSS to children
});
};
}(jQuery));