This repository has been archived on 2023-02-26. You can view files and clone it, but cannot push or open issues or pull requests.
langue-phundrak-com/js/main.js

33 lines
997 B
JavaScript
Raw Normal View History

2019-08-24 23:28:24 +00:00
window.onload = function() {
// Add the possibility for all headers to roll what follows them
['h2', 'h3', 'h4', 'h5', 'h6'].forEach(function(htitle){
$(htitle).addClass('rolled');
});
// Except for the footnotes
$('.footnotes').removeClass('rolled');
// Make the rollable headers actually rollable and rolled
$('.rolled').click(function() {
$header = $(this);
$header.nextAll().each(function() {
$(this).slideToggle(500);
});
$header.toggleClass('unrolled');
$header.toggleClass('rolled');
});
2019-08-24 23:35:23 +00:00
// Move the title out of the content div
2019-08-24 23:28:24 +00:00
$('.title').prependTo($("body"));
2019-08-24 23:35:23 +00:00
// Move the postamble in the content div
2019-08-24 23:28:24 +00:00
$('#postamble').appendTo($("#content"));
2019-08-24 23:35:23 +00:00
// Move each table in a div to handle large tables' overflow
2019-08-24 23:28:24 +00:00
$('table').each(function(){
$table = $(this);
$table.before('<div class="largetable"></div>');
$table.prependTo($table.prev());
});
2019-08-24 23:35:42 +00:00
};