• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

help with show/hide sidebar using jquery

karev

Active member
#1
hello everyone i tried to make a simple jquery code to show and hide sidebar from index i write this little jquery function

Code:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#showhide').click(function() {
$('#showhide').css("cursor","pointer");
$('.mainContent').removeClass("sidebar");
$('#sidebar').toggle();
});
});
</script>
<a id="showhide">click</a> this is the show and hide button
and in add an id="sidebar" to the aside tag in page_container but i cant remove the width of the sidebar when we hide it the is anyone who can help me with this issues please :(