xxxxxxxxxx
1
<!--Double navigation-->
2
<header>
3
<!-- Chat Sidebar -->
4
<div id="slide-out" class="side-nav fixed wide slim">
5
<ul class="custom-scrollbar frndsOnline-custom-scrollbar">
6
<li>
7
<ul class="collapsible collapsible-accordion">
8
<li>
9
<a id="toggle-test" class="waves-effect"> <i class="sv-slim-icon fas fa-angle-double-left"></i>Minimize menu</a>
10
</li>
11
</ul>
12
</li>
13
</ul>
14
</div>
15
<!-- ./Chat Sidebar -->
16
<!-- Navbar -->
17
<nav class="navbar navbar-expand scrolling-navbar double-nav navbar-dark">
18
<!-- Chat Sidebar - Toggle Button -->
19
<div class="float-right"> <a href="#" class="button-collapse" id="frndsOnlineTglBtn" data-activates="slide-out"> <i class="fas fa-bars"></i> click here to open slim sidenav </a> </div>
20
<!-- ./Chat Sidebar - Toggle Button -->
21
</nav>
22
<!-- ./Navbar -->
23
</header>
24
<!-- ./Double navigation-->
25
<main>
26
<p>Watch the <code>.fa-angle-double-left</code> bug</p>
27
<p>When opened, <code>.fa-angle-double-right</code> should be added</p>
28
</main>
xxxxxxxxxx
1
#frndsOnlineTglBtn {
2
color: black;
3
}
4
5
// uncomment to watch the icon vanish instead of getting rotated
6
// or add .fa-rotate-180 with this class to watch it still vanish
7
.fa-angle-double-left {
8
//transform: rotate(180deg);
9
}
10
11
main {
12
padding: 10%;
13
}
xxxxxxxxxx
1
// JavaScript Document
2
$(function () {
3
4
new WOW().init();
5
6
// SideNav Button Initialization
7
$('#frndsOnlineTglBtn.button-collapse').sideNav({
8
edge: 'right'
9
});
10
// SideNav Scrollbar Initialization
11
var sideNavScrollbar = document.querySelector('.frndsOnline-custom-scrollbar');
12
var ps = new PerfectScrollbar(sideNavScrollbar);
13
});
14
15
$(function () {
16
$("#toggle-test").click(function () {
17
if ($("#slide-out").hasClass('slim')) {
18
$("#slide-out").removeClass('slim');
19
$(".sv-slim-icon").removeClass('fa-angle-double-left').addClass('fa-angle-double-right');
20
} else {
21
$("#slide-out").addClass('slim');
22
$(".sv-slim-icon").removeClass('fa-angle-double-right').addClass('fa-angle-double-left');
23
}
24
});
25
});
Console errors: 0