jquery - Responsive menu animation malfunction -
i've made responsive slide in menu. added code responsive view.
it works this. default div.overlay
, ul
hidden. click on .triggerrm
anchor, elements become class called .openrm
, animates (with css-transition):
.overlay
makes black cover on body.triggerrm
left position changed0%
100%
(with bit of margin , background change)ul
right position gets changed100%
(hidden)5em
.
all works charm on computer (win 7 + ff38). when looking android phone ul
transition doesn't work. when button clicked, background pops @ end position without animation.
the rest of animation work.
any ideas??
here 's code:
html
<nav role="navigation"> <ul> <li><a href="#">link 1</a></li> <li><a href="#">link 2</a></li> <li><a href="#">link 3</a></li> <li><a href="#">link 4</a></li> <li><a href="#">link 5</a></li> </ul> <a href="#" class="triggerrm">open menu</a> <div class="overlayrm"></div> </nav>
css
* { margin: 0; padding: 0; list-style: none; } nav ul { display: block; overflow: auto; position: fixed; top: 0; left: 0; right: 100%; bottom: 0; background: blue; z-index: 200; } nav ul li { display: block; width: 100%; height: 46px; line-height: 46px; padding: 0 20px; vertical-align: middle; color: #fff; text-decoration: none; } nav ul li a:hover { background-color: #2849ee; } nav .triggerrm { display: block; position: fixed; z-index: 200; width: 2.5em; height: 2.5em; background: blue; border-radius: 0 7px 7px 0; top: 0; left: 0; text-indent: -1000%; overflow: hidden; background: blue url(http://gvss.ragas1.nl/img/menu-rm-btn.png) center center no-repeat; -webkit-background-size: 50% 50%; -moz-background-size: 50% 50%; -o-background-size: 50% 50%; background-size: 50% 50%; } nav ul, nav .triggerrm, nav .overlayrm { -webkit-transition: 0.5s ease; -moz-transition: 0.5s ease; -o-transition: 0.5s ease; transition: 0.5s ease; } nav ul.openrm { left: 0; right: 5em; } nav .overlayrm.openrm { position: fixed; background: black; top:0; bottom: 0; left: 0; right: 0; opacity: 0.5; z-index: 190; } nav .triggerrm.openrm { left: 100%; background-image: url(http://gvss.ragas1.nl/img/menu-rm-btn-close.png); margin-left: -5em; }
js
$(function() { // responsive menu $("nav .triggerrm, nav .overlayrm").on("click", function(e) { e.preventdefault(); $("nav .triggerrm,nav ul,body,.overlayrm").toggleclass('openrm'); }); });
Comments
Post a Comment