Using the on click function. It works fine at desktop but doesn't work on mobile my Samsung Galaxy S5. I've tried changing click for touchstart and experience the same thing. Works at desktop but not at mobile. Tried putting in click and touchstart but seems to have a double click effect. As the menu works by sliding in. With both settings in it kind of slides left and right a little bit but then stops. Hi Stuart, Not sure I have the exact answer for you but maybe I can help.
You definitely don't want to have both a "click" and "touchstart" event in the same event handler, because every touchscreen treats a "tap" as a pseudo-"click" event, plus will also treat it as a "touchstart" event, so you snugpak jacket review wind up firing off 2 events every time you tap that. And since both events trigger a "toggle" effect, your single tap firing twice will toggle the class on and then off at the same time -- making it look like nothing happened.
Since it sounds like you want this menu to work on desktop and mobile, I'd suggest not using "touchstart" at all, since no non-touchscreen displays recognize it, and all touchscreens interpret taps as "click" events. So use "click" and nothing else. I'm guessing that the event is correctly firing, but something about what you're asking it to do toggle the "anim" class is not doing what you expect.
I suggest you change the function to something like:. I bet it does. Once you know that, at least you can get past wondering what's wrong with the event handler it might not be wrong at all and start troubleshooting where the problem really is. If you posted your CSS it might help troubleshooting. Opened my website with chrome instead of the default internet app on my Samsung Galaxy s5 and the menu worked fine!
Tried testing on browser stack. Working on desktop browsers. For mobiles it worked on: Samsung galaxy S5, S6, S7 chrome and firefox iPhone 7 not sure if browserstack was working properly on other iPhone versions, as friends 6s worked in real life but not in browserstack.
Which works on my default internet app. Implementing this into my website it doesn't work on my default internet app but does on chrome.
Posting to the forum is only allowed for members with active accounts. Please sign in or sign up to post. I forgot my password. Stuart McPherson 15, Points. I have a menu for mobile where when the button is clicked the menu will appear.
It works fine at desktop but doesn't work on mobile my Samsung Galaxy S5 I've tried changing click for touchstart and experience the same thing. Any help on how to get it working on mobile and desktop? Eric Butler 31, Points. Eric Butler Eric Butler 31, Points. Hi Eric, Thanks for helping out. Okay I've left out touchstart, so its just click. Tried your click function with just the alert inside. Worked at desktop. But not on mobile. Switched back to my original function.
Worked on friends iPhone 6S. For mobiles it worked on: Samsung galaxy S5, S6, S7 chrome and firefox iPhone 7 not sure if browserstack was working properly on other iPhone versions, as friends 6s worked in real life but not in browserstack styles.I have created a responsive site that works well on desktop, even when resized down to mobile screen size.
Make sure you have something like the following in your HTML head:. If you have that included and it's still not working, please post all of your code. The easiest way to do this is using a workspace snapshot. You can access this feature using the camera icon in the top right of a workspace.
You are free to use the code below and modify it according to your needs. Thanks to all those who helped and contributed in any way.
In the "Internet Options" window click on the "OK" button to close it. Click on the "Refresh" button of the web browser to refresh the page. Mozilla Firefox In the address bar, type about:config and press Enter.
The dark mode beta is finally here. Change your preferences any time. Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information. This works on a desktop browser, but not on my iOS mobile phone. I tried adding 'touchstart' and looked at this post's solution to check how other's got it to work, but it still isn't working. Any suggestions as to other options? I also tried adding e.
Edit: It appears there may be something else going on, I changed the code to be as general as possible and it is not firing the event on iOS, but working in my chrome emulator:.
As expected, the screen goes blank on my desktop browser for both local and on heroku, but when I test on mobile, the screen is not blank. It looks like js isn't working properly. Answer: the reason it wasn't working on iOS Safari is because in my js page I was using ES6, specifically 'let' which is [not supported currently].
Active 1 year, 1 month ago. Viewed 10k times. Images attached:. Ron I Ron I 2, 5 5 gold badges 24 24 silver badges 48 48 bronze badges. Active Oldest Votes. This should help you. Instead of binding it to the body element, bind the event to the document. I double checked to make sure in my style I added cursor:pointer, and I changed it to document. It still didn't work so I checked my browser console and saw that it was firing two events. I added e.
I think switched it from 'click touchstart' to just click, and now it fires only one event, but it is still not working on mobile.
I then tried 'touchstart' without 'click' and it is not working on mobile either. It works in my mobile emulator in chrome, but not on my iphone. You have two options: Reset your mobile browser's history because your browser's cache reads the old source. Change the name of your source file in the desktop and refresh your page again. Vickel 4, 5 5 gold badges 28 28 silver badges 48 48 bronze badges. Ahmadreza Azimi Ahmadreza Azimi 11 2 2 bronze badges. Sign up or log in Sign up using Google.
The application is written in asp. I place a reference to the file in the body content placeholder of each page that needs it and that works fine on any device before the menu collapses. I've tried placing it in different parts of the page bottom of content placeholder, in the header placeholder as well as in the master page both in the body and header.
Print Share Twitter Facebook Email. Nan Yu All-Star. NET Forum. Best Regards, Nan Yu.Keep in touch and stay productive with Teams and Officeeven when you're working remotely. Learn how to collaborate with Office Tech support scams are an industry-wide issue where scammers trick you into paying for unnecessary technical support services. You can help protect yourself from scammers by verifying that the contact is a Microsoft Agent or Microsoft Employee and that the phone number is an official Microsoft global customer service number.
Just to clarify, this is a mobile web app, not a native mobile app. This works because the previous line 71 was calling the jquery append. Your best bet would be finding a way to remotely debug what's happening in the native browser.
There are a couple ways to do this. Learn more. Asked 6 years, 9 months ago. Active 6 years, 9 months ago. Viewed 11k times. My problem is that it works ok except for on iPad Android 4.
The problem with these browsers is that the content isn't being rendered. It works fine on Android 4. Jez D. Jez D Jez D 1, 1 1 gold badge 19 19 silver badges 47 47 bronze badges.
Active Oldest Votes. After days of research and testing, I have found the solution. Nick Davis Nick Davis 3 3 silver badges 9 9 bronze badges. Sign up or log in Sign up using Google.
Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Featured on Meta. Feedback on Q2 Community Roadmap.