Difference between revisions of "Template:Sidebar"
Adelo Vieira (talk | contribs) |
Adelo Vieira (talk | contribs) |
||
Line 116: | Line 116: | ||
display: block; | display: block; | ||
position: relative; | position: relative; | ||
− | top: | + | top: -145px; |
− | margin-left: | + | margin-left: -205px; |
padding-left: 10px; | padding-left: 10px; | ||
-webkit-user-select: none; | -webkit-user-select: none; | ||
Line 250: | Line 250: | ||
so you can use the :checked selector on it. | so you can use the :checked selector on it. | ||
--> | --> | ||
− | <input id="inputButton" type="checkbox" /> | + | <input id="inputButton" type="checkbox" onclick="myFunction()"/> |
<!-- | <!-- | ||
Line 307: | Line 307: | ||
<script> | <script> | ||
− | + | function myFunction() { | |
− | + | var checkBox = document.getElementById("inputButton"); | |
− | + | if (checkBox.checked == true){ | |
− | + | $('#content').css('margin-left', '300px') | |
− | + | $('#left-navigation').css({'cssText':'margin-left:300px'}) | |
− | + | $('#menuToggle').css('margin-left', '-325px') | |
− | + | $('#footer').css('margin-left', '308px') | |
− | + | } else { | |
− | + | $('#content').css('margin-left', '180px') | |
− | + | $('#left-navigation').css({'cssText':'margin-left:180px'}) | |
− | + | $('#menuToggle').css('margin-left', '-205px') | |
− | + | $('#footer').css('margin-left', '180px') | |
− | + | } | |
− | + | } | |
function checkUser(){ | function checkUser(){ | ||
Line 359: | Line 359: | ||
checkBox.checked = true | checkBox.checked = true | ||
} | } | ||
− | + | myFunction() | |
e.preventDefault() | e.preventDefault() | ||
} | } | ||
Line 381: | Line 381: | ||
} | } | ||
− | function moveSidebarToBody() { | + | // function moveSidebarToBody() { |
− | + | // document.body.appendChild(document.getElementById('MySidebar')) | |
− | } | + | // } |
$(document).ready( function() { | $(document).ready( function() { | ||
Line 390: | Line 390: | ||
collapseAll() | collapseAll() | ||
removeCSS() | removeCSS() | ||
− | moveSidebarToBody() | + | // moveSidebarToBody() |
}); | }); | ||
checkUser() | checkUser() | ||
collapseAll() | collapseAll() | ||
removeCSS() | removeCSS() | ||
− | moveSidebarToBody() | + | // moveSidebarToBody() |
}); | }); | ||
</script> | </script> |
Revision as of 00:03, 10 March 2021