Mudanças entre as edições de "Widget:Teste"
Ir para navegação
Ir para pesquisar
m |
m |
||
| Linha 1: | Linha 1: | ||
< | <style> | ||
.teste-caixa { | |||
border: 1px solid #444; | |||
border-radius: 6px; | |||
padding: 10px; | |||
max-width: 36em; | |||
font-family: system-ui, sans-serif; | |||
} | |||
.teste-caixa h3 { | |||
margin: 0 0 8px; | |||
font-size: 1.1em; | |||
</ | } | ||
.teste-caixa .teste-corpo { | |||
margin: 0; | |||
} | |||
.teste-caixa .teste-corpo.teste-colapsado { | |||
max-height: 3.2em; | |||
overflow: hidden; | |||
} | |||
.teste-caixa button.teste-toggle { | |||
margin-top: 8px; | |||
cursor: pointer; | |||
} | |||
</style> | |||
<script> | <script> | ||
(function() { | (function () { | ||
function init() { | |||
document.querySelectorAll('.teste-caixa').forEach(function (box) { | |||
if (box.dataset.testeInit) return; | |||
box.dataset.testeInit = '1'; | |||
var body = box.querySelector('.teste-corpo'); | |||
var btn = box.querySelector('.teste-toggle'); | |||
if (!body || !btn) return; | |||
var aberto = false; | |||
btn.addEventListener('click', function () { | |||
aberto = !aberto; | |||
body.classList.toggle('teste-colapsado', !aberto); | |||
btn.textContent = aberto ? 'Recolher' : 'Expandir'; | |||
}); | |||
}); | |||
} | |||
if (document.readyState === 'loading') { | |||
document.addEventListener('DOMContentLoaded', init); | |||
} else { | |||
init(); | |||
} | } | ||
})(); | })(); | ||
</script> | </script> | ||
Edição das 00h22min de 1 de abril de 2026
<style> .teste-caixa {
border: 1px solid #444; border-radius: 6px; padding: 10px; max-width: 36em; font-family: system-ui, sans-serif;
} .teste-caixa h3 {
margin: 0 0 8px; font-size: 1.1em;
} .teste-caixa .teste-corpo {
margin: 0;
} .teste-caixa .teste-corpo.teste-colapsado {
max-height: 3.2em; overflow: hidden;
} .teste-caixa button.teste-toggle {
margin-top: 8px; cursor: pointer;
} </style> <script> (function () {
function init() {
document.querySelectorAll('.teste-caixa').forEach(function (box) {
if (box.dataset.testeInit) return;
box.dataset.testeInit = '1';
var body = box.querySelector('.teste-corpo');
var btn = box.querySelector('.teste-toggle');
if (!body || !btn) return;
var aberto = false;
btn.addEventListener('click', function () {
aberto = !aberto;
body.classList.toggle('teste-colapsado', !aberto);
btn.textContent = aberto ? 'Recolher' : 'Expandir';
});
});
}
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', init);
} else {
init();
}
})(); </script>