Created
August 25, 2013 02:43
-
-
Save sakadonohito/6331657 to your computer and use it in GitHub Desktop.
ヘッダ固定でボディだけスクロールさせる
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(function(){ | |
| function table_adjust(){ | |
| var width_arr = new Array(); | |
| var tbody_tds = $('#estimateList tbody tr:first-child td'); | |
| var thead_ths = $('#estimateList thead tr:first-child th'); | |
| $.each($(tbody_tds),function(i){ | |
| width_arr.push($(this).width()); | |
| }); | |
| $.each($(thead_ths),function(i){ | |
| $(this).width(width_arr[i]); | |
| }); | |
| } | |
| $(document).ready(function(){ | |
| table_adjust(); | |
| }); | |
| $(window).resize(function(){ | |
| table_adjust(); | |
| }); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #list-box{ | |
| height: 380px; | |
| padding-top: 80px; | |
| position: relative; | |
| float: none; | |
| } | |
| .scroll { | |
| overflow-x: auto; | |
| overflow-y: auto; | |
| height: 380px; | |
| } | |
| #list-box thead { | |
| clear: both; | |
| float: none; | |
| position: absolute; | |
| top: 0px; | |
| left: 0px; | |
| height: 80px; | |
| overflow-x: auto; | |
| overflow-y: hidden; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment