Widget:ToggleWidth: Difference between revisions

From The Midnight Wiki
No edit summary
No edit summary
Line 1: Line 1:
<noinclude>
<noinclude>
{{#widget:ToggleWidth}}
 
</noinclude>
</noinclude>


<includeonly>
<includeonly>
<html>
<button onclick="myFunction()">Try it</button>
<script>
<script>
function changeWidth() {
function myFunction() {
   var x = document.getElementsByClassName("ts-inner");
   var x = document.getElementsByClassName("ts-inner");
   if (x.style.maxWidth === "none") {
  for (i in x) {
     x.style.maxWidth = "115em !important";
   if (x[i].style.maxWidth === "none") {
     x[i].style.maxWidth = "115em";
   } else {
   } else {
     x.style.maxWidth = "none !important";
     x[i].style.maxWidth = "none";
   }
   }
}
}
}
</script>
</script>
<button onclick="changeWidth()">Try it</button>
</html>
</includeonly>
</includeonly>

Revision as of 14:31, 5 July 2023