I have a navigation bar that on mobile it has overflow and for people to see all the choices they need to scroll to the right or to the left. I want to add buttons with arrows so when people click for example on the right one the nabber will slide on its own to the right.
I have tried jQuery
$('#admin-menu').animate({width:'toggle'},350);
or
$(#admin-menu).show("slide", { direction: "left" }, 1000);
or
$('#admin-menu').slideToggle( "slow" );
but none of this seems to work how I want, it makes the nabber dissappear.
the menu bar with slider
<nav id="admin-menu">
<span class="tab active" id="locations-tab">
<h6>Dashboard</h6>
</span>
<span class="tab" id="users-tab">
<h6>Users</h6>
</span>
<span class="tab" id="users-tab">
<h6>Users</h6>
</span>
<span class="tab" id="users-tab">
<h6>Users</h6>
</span>
<span class="tab" id="users-tab">
<h6>Users</h6>
</span>
<span class="tab" id="users-tab">
<h6>Users</h6>
</span>
</nav>
//The button to slide
<i class="fas fa-chevron-circle-right right-slider" onClick="slider()"></I>
The function
function slider(){
console.log('Im here!!')
$('#admin-menu').animate({width:'toggle'},50);
}
I want to be able to click the button and have the navigation-bar scroll to the left.