Hello,
I have been trying to hide and show css with button click:
home.blade.php
#container{
display: grid;
grid-template-columns: 350px auto 300px;
grid-template-rows: 800px 800px 800px;
grid-template-areas:
"menu cont sidenav";
position: fixed;
z-index: 1;
color: black;
}
menu {
grid-area: menu;
}
cont{
grid-area: cont;
background: white;
padding: 50px;
}
cont p{ color:black; }
sidenav {
grid-area: sidenav;
background: orange;
padding: 50px;
color: black;
}
...
<li>
<input id="c10" type="checkbox">
<label for="c10">
<a href="{{ action('HomeController@getArticles') }}" onclick="hidePages()">
@if($uri=="home/articles")
<!-- <img src="{{url("")}}/images/button-10-hover.png"/> -->
<div id="circle1"><div style="margin: -10px 0 0 0;"><img src="{{url("")}}/images/add/icons5-hover.png" width="30px" /></div></div>
@else
<!-- <img src="{{url("")}}/images/button-10.png"/> -->
<div id="circle1"><div style="margin: -10px 0 0 0;"><img src="{{url("")}}/images/add/icons5.png" width="30px" /></div></div>
@endif
</a>
</label>
</li>
<li>
...
<script>
function hidePages() {
var x = document.getElementById("container");
if (x.style.display === "none") {
x.style.display = "block";
} else {
x.style.display = "none";
}
}
</script>
pages.blade.php
<section id="container">
<menu></menu>
<cont>
<center><b>{{ $pages2->pages_title }}</b></center><br>
{!! $pages2->pages_content !!}
</cont>
<sidenav>
@foreach( $pages as $p)
<a href="{{url('')}}/home/pages/{{ $p->id }}">{{ $p->pages_name }}</a><br><br>
@endforeach
</sidenav>
</section>
I am using the grid system. Since it only works in <div id="container"> while I need to use <section id="container"> to make the grid system works. now what should I do? I need to hide whole whole container since it is overlapping the articles.
Well I already try using the <div id="container"> and it still does not hide the content under it.