Difference between revisions of "MediaWiki:Common.js"

Jump to: navigation, search

Difference between revisions of "MediaWiki:Common.js"

(Blanked the page)
(Tag: Blanking)
Line 1: Line 1:
// Change the selector if needed
 
var $table = $('table.scroll'),
 
    $bodyCells = $table.find('tbody tr:first').children(),
 
    colWidth;
 
  
// Adjust the width of thead cells when window resizes
 
$(window).resize(function() {
 
    // Get the tbody columns width array
 
    colWidth = $bodyCells.map(function() {
 
        return $(this).width();
 
    }).get();
 
   
 
    // Set the width of thead columns
 
    $table.find('thead tr').children().each(function(i, v) {
 
        $(v).width(colWidth[i]);
 
    });   
 
}).resize(); // Trigger resize handler
 

Revision as of 22:41, 4 November 2020