JavaScript Toggling Class to show/hide navigation not working in Chrome for Android 4.2 (v31)

I have following markup for my nav-menu and menu icon to toggle it.

<a target='_blank' href="#navigation" class="toggle-menu">&#9776;</a>
<nav id="navigation">
    <a target='_blank' href="#" class="nav-item nav-blog active">Blog</a>
    <a target='_blank' href="#" class="nav-item nav-projects">Projects</a>
    <a target='_blank' href="#" class="nav-item nav-showcase">Showcase</a>
    <a target='_blank' href="#" class="nav-item nav-social">Social</a>
    <a target='_blank' href="#" class="nav-item nav-about">About</a>
    <a target='_blank' href="#" class="nav-item nav-close">&times;</a>
</nav>

In which all menu items stack up vertically when viewing in Smartphone in portrait mode (I use CSS media queries).

Following is the initial style of menu items.

nav {
   position: fixed;
   top: 0;
   padding-top: 60px;
}

nav .nav-item {
   display: table;
   margin-top: 10px;
   padding: 2px 10px 2px 10px;
   width: auto;
   font-size: 2.5em;
   text-align: left;
   margin-left: -230px; /* Keep menu items off-screen by default. */
   z-index: 1000;
   -webkit-transition: margin-left 0.2s ease;
      -moz-transition: margin-left 0.2s ease;
        -o-transition: margin-left 0.2s ease;
           transition: margin-left 0.2s ease;
}

/* Show Menu on :target or via JS */
nav:target .nav-item,
nav.open .nav-item {
    margin-left: 0;
    transition: margin-left 0.2s ease;
}

And now I toggle open class on nav-menu upon click of a.toggle-menu, this works fine and as expected in Chrome Canary 34 (DevTools device emulator) on Desktop, Firefox 26 running on Android 4.2, but it is giving unexpected behaviours in Chrome 31 on Android, as well as any other browser on Android (that uses WebView).

What's happening is when page is loaded for first time, and I tap on Menu icon, it shows Nav-menu with transition, and tapping again on Close hides it, but when I tap again the same menu icon, it doesn't show up, but if I double-tap on page (which usually zooms-in the page 1 level), nav-menu appears (without any transition, like it was already present there), and then tapping on close hides it, and this behaviour continues until I reload the page again.

Note that I'm currently using jQuery 2.0.3 for event handlers, and this problem persists with both ways of showing/hiding of menu, with JS, without JS.

Any help will be appreciated.

Answer:1

Try:

nav {
   position: absolute;
   top: 0;
   padding-top: 60px;
}

nav .nav-item {
   display: block;
   margin-top: 10px;
   padding: 2px 10px 2px 10px;
   width: auto;
   font-size: 2.5em;
   text-align: left;
   margin-left: -230px; /* Keep menu items off-screen by default. */
   z-index: 1000;
   -webkit-transition: margin-left 0.2s ease;
      -moz-transition: margin-left 0.2s ease;
        -o-transition: margin-left 0.2s ease;
           transition: margin-left 0.2s ease;
}

/* Show Menu on :target or via JS */
nav:target .nav-item,
nav.open .nav-item {
    margin-left: 0 !important;
}
Answer:2

I have this code on my jquery participantText += '<div class="wrap_col td7"><input type="image" src="/pc/images/callgray.png" style="vertical-align: middle" class="actionInvite"></div&...

I have this code on my jquery participantText += '<div class="wrap_col td7"><input type="image" src="/pc/images/callgray.png" style="vertical-align: middle" class="actionInvite"></div&...

  1. button doesn't work html
  2. button doesn't work on ipad
  3. button doesn't work on keyboard
  4. button doesn't work unity
  5. button doesn't work on first click
  6. button doesn't work on iphone
  7. button doesn't work
  8. button doesn't work on mobile
  9. excel button doesn't work
  10. apple watch button doesn't work
  11. java button doesn't work
  12. button doesn't work on macbook
  13. button doesn't work in firefox
  14. button doesn't work on chrome
  15. button doesn't work laptop
  16. button doesn't work on android
  17. button doesn't work meme
  18. javascript button doesn't work
  19. wix button doesn't work
  20. button doesnt work internet explorer

In traditional code I will pass arguments to link button like this: <a href="javascript:call_hello(1, 2, 3)" role="button">Hello</a> How can I do it in unobtrusive JavaScript style with ...

In traditional code I will pass arguments to link button like this: <a href="javascript:call_hello(1, 2, 3)" role="button">Hello</a> How can I do it in unobtrusive JavaScript style with ...

  1. pass arguments function python
  2. pass arguments function addeventlistener
  3. pass arguments function php
  4. pass arguments function c
  5. pass argument function javascript
  6. pass argument function bash
  7. pass argument function pointer
  8. pass argument function vba
  9. pass args function
  10. pass argument function callback
  11. pass function arguments r
  12. pass function arguments js
  13. pass function argument to decorator
  14. pass function argument java
  15. pass function argument
  16. pass function argument scala
  17. pass function argument jquery
  18. pass function argument constructor
  19. pass function argument character
  20. pass arguments to function in shell script

i am trying to creat a carousel animation that take 3 pics and slide the to the left and bring new 3 images, i don't think i'm in the right direction need help here is the fiddle link: http://...

i am trying to creat a carousel animation that take 3 pics and slide the to the left and bring new 3 images, i don't think i'm in the right direction need help here is the fiddle link: http://...

I have a html string var str = '<span class="linq" onclick="ShowData(2,-1,1);">11111</span> &nbsp;»&nbsp; <span class="linq" onclick="ShowData(16,1,1);">22222</span> &...

I have a html string var str = '<span class="linq" onclick="ShowData(2,-1,1);">11111</span> &nbsp;»&nbsp; <span class="linq" onclick="ShowData(16,1,1);">22222</span> &...

  1. split html string c#
  2. split html string javascript
  3. split html string
  4. split html string jquery
  5. split html string php
  6. html split string into lines
  7. html split string into array
  8. split string html tags
  9. javascript split html string into array
  10. js split html string
  11. python split html string
  12. angular html split string
  13. django html split string
  14. c# split string html tags
  15. php split string html tags
  16. java split string html tags
  17. angularjs html split string
  18. html split long string
  19. html string split function