Multiple JS "If" statements
by Jordan Dayton
HTML
<div class="nav customstyle2 taxforums">
<input type="checkbox" id="menu" checked />
<label for="menu"></label>
<div class="multi-level">
<div class="item">
<input type="checkbox" id="TOPIC1" />
<label for="TOPIC1"><button type="button"><a href="/questions-discussions/f/free-cpe-courses/">Visit Forum</a></button>Canopy's FREE CPE Courses</label>
<ul>
<li><a href="ENTER_TAG_URL">Add_Sub_Category</a></li>
<li><a href="ENTER_TAG_URL">Add_Sub_Category</a></li>
<li><a href="ENTER_TAG_URL">Add_Sub_Category</a></li>
</ul>
</div>
<div class="item">
<input type="checkbox" id="forum_accounting" />
<label for="forum_accounting">Accounting & Financial Audit</label>
<ul>
<li><a href="ENTER_TAG_URL">Add_Sub_Category</a></li>
<li><a href="ENTER_TAG_URL">Add_Sub_Category</a></li>
<li><a href="ENTER_TAG_URL">Add_Sub_Category</a></li>
</ul>
</div>
</div>
</div>
CSS
html,
body {
width: 100%;
margin: 0;
padding: 0;
font-family: helvetica;
font-size: 12px;
}
/*Functionalty*/
.taxforums .multi-level,
.item ul,
.nav input[type="checkbox"] {
display: none;
}
.taxforums #menu:checked~.multi-level,
.item input:checked~ul {
display: block;
}
/*Arrow*/
.taxforums .arrow {
width: 10px;
height: 10px;
vertical-align: middle;
float: left;
margin: 9px 0.5em 0 2em;
}
.taxforums .item input+.arrow {
transform: rotate(-90deg);
transition: 0.1s;
}
.taxforums .item input:checked+.arrow {
transform: rotate(0deg);
transition: 0.1s;
}
/*Styles*/
.taxforums label:hover {
cursor: pointer;
background-color: #f2f2f2;
position: relative;
}
.taxforums li:hover {
background-color: #f2f2f2;
}
.taxforums label {
width: 100%;
display: block;
position: relative;
}
.taxforums .nav {
width: 100%;
background-color: white;
overflow-x: hidden;
/*border-bottom: 1px solid #CFD8DC;*/
}
/*#nav-icon {font-size: 28px;line-height: 50px;padding-left: 1em;color: white;background-color: #F44336;}*/
.taxforums .nav ul,
.nav li,
label {
line-height: 30px;
margin: 0;
padding: 0 2em;
list-style: none;
text-decoration: none;
color: #000;
font-weight: 100;
width: 120%;
}
.taxforums .item ul {
margin-left: -3em;
width: 100%;
}
.taxforums .nav li a {
line-height: 30px;
margin: 0;
padding: 0 2em;
list-style: none;
text-decoration: none;
color: #000;
font-weight: 100;
width: 100%;
}
.taxforums .item label:before {
content: '';
background: url(https://png.icons8.com/material/50/000000/expand-arrow.png);
width: 10px;
background-size: 100%;
height: 10px;
position: absolute;
top: 9px;
left: 9px;
transform: rotate(-90deg);
}
.taxforums .item input:checked+label:before {
transform: rotate(0);
}
.taxforums .sub-item {
padding: 0 -1em;
}
.taxforums button {
display: none;
float: right;
position: absolute;
right: 6em;
top: 50%;
transform:...
JavaScript
$(document).ready(function () {
if(window.location.href.indexOf("fiddle") > -1) {
document.getElementById("TOPIC1").checked = true;
}
});