As i do not have much experience with jquery i have one problem, for which i can't find solution.
So, here is script code for custom header i made for one of my styles.
<script>
$(document).ready(function(){
$(".hideb").click(function(){
$("nav.IndexPage-nav.sideNav, .Header-title, .App-header, .App:before").toggle();
var x = $('.IndexPage').css("margin-left");
if (x=="-200px"){
$('.IndexPage').css("margin-left", "-280px");
}
else{
$('.IndexPage').css("margin-left", "-200px");
}
var y = $('.App-content').css("margin-left");
if (y=="200px"){
$('.App-content').css("margin-left", "auto");
}
else{
$('.App-content').css("margin-left", "200px");
}
var z = $('.hideb').css("left");
if (z=="250px"){
$('.hideb').css("left", "0");
}
else{
$('.hideb').css("left", "250px");
}
var c = $('.Header-title').css("display");
if (c = "none"){
$('.nav.IndexPage-nav.sideNav').css("display", "none");
}
else{
$('.nav.IndexPage-nav.sideNav').css("display", "block");
}
var c = $('.App-header').css("display");
if (c = "none"){
$('.nav.IndexPage-nav.sideNav').css("display", "none");
}
else{
$('.nav.IndexPage-nav.sideNav').css("display", "block");
}
});
});
</script>
Everything is working fine except
var c = $('.App-header').css("display");
if (c = "none"){
$('.nav.IndexPage-nav.sideNav').css("display", "none");
}
else{
$('.nav.IndexPage-nav.sideNav').css("display", "block");
}
So if i press the button, all elements are hidden, but if i open any discussion and press back button the -.nav.Sidenav element is visible when sidebar is hidden, which should not be happening.
How can i fix this?
Demo:https://style2.freeflarum.com/
if my explanation is not clear enough.