Hi
Last year PaulOB kindly assisted me here:
Now I tried implementing it into a website, with some changes which I think created the issue, by checking the original test I loaded here: ttri dot biz/fz_test/06 (PaulOB’s https://codepen.io/paulobrien/pen/vpNNPq) I noticed a small issue which I think is somehow related.
When on small device (smartphone) the sliding overlay seems to cover the menu, and the dropdown is not available, and the item behaves as link to the same page.
The original test does show the dropdown list, but the overlay is visible (ttri dot biz/fz_test/06) instead of coming to screen on hover.
The site I am trying to implement it on is:
editricebahai dot com/clean-155/
It all works as it should on desktop when resizing the browser!
The below code is integrated with bootstrap 3.3.7
This is the css
.slidenav, .slidenav ul {
margin:0;
padding:0;
list-style:none;
}
.slidenav{position:relative;}
.slidenav > li{
padding:0 0 4px;
position:relative;
}
.slidenav > li:hover{z-index:99}
.slidenav > li > a{
display:block;
position:relative;
background:rgba(221, 221, 221, 0.7);
text-decoration:none;
color:#727272;
border-left:18px solid #db0078;
padding:9px 0 9px 18px;
overflow:hidden;
font-weight:bold;
}
/* the login button - note background, and text color */
.slidenav > li > .fz-login-button {
background:#337ab7;
color:#fff;
border-left:18px solid #000095;
}
/* login text color when logged in */
#fz-logged-in {
color:#f00;
}
.slidenav > li > a {text-shadow:-300px 0 0 #999;transition:text-shadow .8s ease;}
.slidenav > li:hover > a{text-shadow:1px 1px 0 #000;}
.slidenav > li > a:before{
content:"";
position:absolute;
left:0;
right:0;
top:0;
bottom:0;
z-index:2;
transition:transform 1s ease;
transform:translateX(-100%);
}
.slidenav > li:hover > a:before {transform:translateX(0);}
/* fixed left color */
/*
.slidenav > li:nth-child(1) > a {border-color: #db0078;}
.slidenav > li:nth-child(2) > a {border-color: #722ba8;}
.slidenav > li:nth-child(3) > a {border-color: #532099;}
.slidenav > li:nth-child(4) > a {border-color: #3f3cad;}
.slidenav > li:nth-child(5) > a {border-color: #005b9a;}
*/
/* use above styles for different colors */
.slidenav > li > a {border-color: #999;}
/* login button border */
.slidenav > li > .fz-login-button {border-color: #000095;}
/* default sliding colours*/
/*
.slidenav > li:nth-child(1) > a:before{background:rgba(190, 190, 190, 0.7);}
.slidenav > li:nth-child(2) > a:before{background:rgba(114, 43, 168, 0.7);}
.slidenav > li:nth-child(3) > a:before{background:rgba(83, 32, 153, 0.7)}
.slidenav > li:nth-child(4) > a:before{background:rgba(63, 60, 173, 0.7);}
.slidenav > li:nth-child(5) > a:before{background:rgba(0, 91, 154, 0.7);}
*/
/* use above styles for different colors */
.slidenav > li > a:before{background:rgba(190, 190, 190, 0.7);}
/* if you want color to change on hover then change these 5 rules */
/*
.slidenav > li:nth-child(1):hover > a:before{background:rgba(219, 0, 114, 0.7);}
.slidenav > li:nth-child(2):hover > a:before{background:rgba(114, 43, 168, 0.7);}
.slidenav > li:nth-child(3):hover > a:before{background:rgba(83, 32, 153, 0.7)}
.slidenav > li:nth-child(4):hover > a:before{background:rgba(63, 60, 173, 0.7);}
.slidenav > li:nth-child(5):hover > a:before{background:rgba(0, 91, 154, 0.7);}
*/
.dropdown > a:after{
content:"";
width: 0;
height: 0;
border-top: 6px solid transparent;
border-bottom: 6px solid transparent;
border-left: 6px solid #000;
display:inline-block;
vertical-align:middle;
margin:-2px 0 0 5px;
}
ul.sub {
position:absolute;
width:50%;
left:50%;
margin-left:-999em;/* fallback*/
margin-left:-100vw;
top:-90%;
opacity:0;
background-color: #ccc;
z-index:-1;
box-shadow:5px 5px 5px rgba(0,0,0,0.4);
/* comment the next line out if you want the submenu to disappear quickly */
transition:opacity 1s ease .1s, top .1s ease .5s, margin 0s 1s;
}
.dropdown:hover .sub {
top:0;
margin-left:0;
opacity:1;
transition:opacity 1s ease .5s, top .5s ease .5s;
z-index:99;
}
.sub a{
display:block;
color:#454545;
padding:9px;
text-decoration:none;
}
.sub a:hover{background:#d9d9d9;color:#454545;}
@media screen and (max-width:800px){
.slidenav{width:auto;margin:9px 0;}
}
@media screen and (min-width:768px) and (max-width:999px){
ul.sub {
width:72%;
left:28%;
}
}
@media screen and (max-width:480px){
ul.sub {
width:81%;
left:19%;
}
}
And this the html (sample)
<div class="row fz-top-nav">
<nav class="navbar navbar-default">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar toggle-1"></span>
<span class="icon-bar toggle-2"></span>
<span class="icon-bar toggle-3"></span>
<span class="icon-bar toggle-4"></span>
<span class="icon-bar toggle-5"></span>
</button>
</div><!-- .navbar-header -->
<div class="navbar-collapse collapse">
<div class="sidebar-links">
<div class="row">
<div class="col-xs-12">
<ul class="slidenav">
<li><a class="fz-login-button" href="http://ttri.biz/fz_test">top-1</a></li>
<li class="dropdown"><a id="fz-logged-in" href="#">top-2</a>
<ul class="sub">
<li><a href="01/">sub-2-1</a></li>
<li><a href="02/">sub-2-2</a></li>
</ul>
</li>
</ul>
</div>
</div>
<ul class="slidenav">
<li class="dropdown"><a href="#">top-3</a>
<ul class="sub">
<li><a href="04/">sub-3-1</a></li>
<li><a href="05/">sub-3-2</a></li>
</ul>
</li>
<li><a href="#">top-4</a></li>
<li class="dropdown"><a href="#">top-5</a>
<ul class="sub">
<li class="dropdown">
<ul class="dropdown-menu-fz" role="menu">
<li><a href="06/">sub-5-1</a></li>
<li><a href="07/">sub-5-2</a></li>
<li><a href="08/">sub-5-3</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div><!-- .sidebar-links -->
</div><!-- .navbar-collapse .collapse -->
</nav>
</div><!-- .row .fz-top-nav -->
Thank you
Apologies if I should’ve posted on the old thread instead of opening new one.