简体   繁体   中英

Materialize Sidenav not working on iOS or iPhone but works on all other devices

Materialize Sidenav not working on iPad or iPhone but on all other devices. Here is a link to the repo if you want to see the code: repo see index.html (line 44 down) and js/onloadSetup.js

I tried adding this in onloadSetup.js :

$('#menu').on('click', function() {
    $('.sidenav').sidenav('open');
  });

but I had no luck.

Tried following this link but I got no luck. Can someone help me? Thank you!

UPDATE : Hours later it just started working on my iPad. I don't know what changes affected it or if any did. I'm guessing it was the above code I added but this code should not be needed. Anyhow problem solved, I just wish I new why it is now working.

您应该只能在实例上使用open方法:

$('.sidenav').open();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM