Add wrap figures
This commit is contained in:
13
js/script.js
13
js/script.js
@@ -62,6 +62,19 @@ docReady(function() {
|
||||
}
|
||||
});
|
||||
|
||||
// Wrap Images and Tables
|
||||
docReady(function() {
|
||||
let wrap_elements = document.querySelectorAll('[float=wrap-right]')
|
||||
for (let wrap_el of wrap_elements) {
|
||||
wrap_el.closest('.figure').classList.add('wrap-right')
|
||||
}
|
||||
|
||||
wrap_elements = document.querySelectorAll('[float=wrap-left]')
|
||||
for (let wrap_el of wrap_elements) {
|
||||
wrap_el.closest('.figure').classList.add('wrap-left')
|
||||
}
|
||||
});
|
||||
|
||||
// Equivalent of Jquery $.ready
|
||||
function docReady(fn) {
|
||||
// see if DOM is already available
|
||||
|
Reference in New Issue
Block a user