• 0

CSS Dropdown Menu not working on iOS


Question

Hey,

I did some work on a site recently, and everything was going fine. Except one bug I can't seem to fix..

Under Safari on iOS 7, the dropdown menu does't work. It works for Android browsers (Firefox, default, Opera), but not iOS Safari.

I was hoping a fresh pair of eyes might help. It's most likely something stupid screwing it up lol

The following menu items should have a dropdown: About, Members, Search, Resources, Links

Thanks for any help

 

http://www.albertaauctioneers.com/

5 answers to this question

Recommended Posts

  • 0

I guess ios opens the link of the dropdown button before even opening the dropdown.

I suggest to make the website mobile friendly instead with media queries and use a sidebar menu or a dropdown select element for the menu ^^

 

As example you can add a select element with all the menu options underneath the menubar and show it when the device width is smaller then a certain width(700px or such).

 

Lemme make a jsfiddle ;)

 

Update:

 

Resize browser window width to see the menu change.

http://jsfiddle.net/LRSzk/embedded/result/

 

Code:

http://jsfiddle.net/LRSzk/

  • 0

The quick easy fix for CSS dropdown menus to work in iOS is simply adding onmouseover="" to the elements that should display the dropdownmenu.

 

But if you really want to make it fully mobile friendly I would recommand Seahorsepip's suggestion.

  • Like 2
  • 0
  On 13/03/2014 at 18:23, SinsOfCube said:

The quick easy fix for CSS dropdown menus to work in iOS is simply adding onmouseover="" to the elements that should display the dropdownmenu.

 

But if you really want to make it fully mobile friendly I would recommand Seahorsepip's suggestion.

Ahh nice trick on using that js trigger attribute to force ios to think it has a mouseover event ^^

  • 0
  On 13/03/2014 at 18:10, Seahorsepip said:

I guess ios opens the link of the dropdown button before even opening the dropdown.

I suggest to make the website mobile friendly instead with media queries and use a sidebar menu or a dropdown select element for the menu ^^

 

As example you can add a select element with all the menu options underneath the menubar and show it when the device width is smaller then a certain width(700px or such).

 

Lemme make a jsfiddle ;)

 

Update:

 

Resize browser window width to see the menu change.

http://jsfiddle.net/LRSzk/embedded/result/

 

Code:

http://jsfiddle.net/LRSzk/

Those menu items aren't actually links, they are just text. So the links aren't loaded before the dropdown appears.

I thought about making a mobile site, but it wasn't in the budget...Though I did originally want to make one. Problem is though, the banner is too big, and I suck at making graphics lol So I couldn't whip something up..Though that is an interesting way of doing that..I had wondered how I was going to make a mobile friendly menu, thanks for the idea! :)

 

  On 13/03/2014 at 18:23, SinsOfCube said:

The quick easy fix for CSS dropdown menus to work in iOS is simply adding onmouseover="" to the elements that should display the dropdownmenu.

 

But if you really want to make it fully mobile friendly I would recommand Seahorsepip's suggestion.

I'll give that a try tonight, thanks :)

 

Thank you both for the help :) Will try the mouseover first, and while I look into making a mobile site

  • 0

Using SinsOfCube's idea of mouseover, and finally got it tested by the bosses, and it seems to work. Very clever, thanks :)
Though Seahorsepip's suggestion is of course also correct. I'll be working on a mobile version soon hopefully, and will probably use his suggestion :)

This topic is now closed to further replies.
  • Popular Now

  • Posts

    • how am i gonna teach my grandma understand a new OS now ?
    • Well, Satya Nadella did say 30% of Microsoft's code is written by AI. Considering that code is also reviewed and tested by the same AI: garbage in, Microsoft code out.
    • Spotify 1.2.66.445 by Razvan Serea Spotify for Windows is your ultimate music and podcast streaming app, designed for a seamless listening experience. Enjoy millions of songs, curated playlists, and personalized recommendations tailored to your taste. Spotify delivers high-quality audio streaming with bitrates up to 320 kbps for Premium users and 160 kbps on the Free tier. Music is streamed in Ogg Vorbis format on the app and AAC on web browsers, ensuring efficient delivery and compatibility. Adaptive bitrate technology adjusts quality based on network conditions, while Premium users enjoy offline downloads for uninterrupted playback. Podcasts are streamed at slightly lower bitrates, typically 96-128 kbps, to balance quality and data usage. Spotify works across smartphones, desktops, smart speakers, game consoles, and more, with Spotify Connect enabling smooth cross-device playback. Features like real-time lyrics, curated playlists, and personalized EQ settings elevate the listening experience, making Spotify a versatile platform for music and podcasts alike. Spotify Free features: Stream Millions of Songs - Access a vast library of music across various genres and artists. Curated Playlists - Discover ready-made playlists for every mood and moment. Shuffle Play Mode - Enjoy songs in random order with shuffle-enabled playback. Personalized Recommendations - Get music suggestions based on your listening habits. Access to Podcasts - Explore a wide range of podcasts on topics you love. Ad-Supported Listening - Stream music with occasional audio and display ads. No Subscription Required - Enjoy music without any payment commitment. Cross-Device Sync - Listen seamlessly on mobile, desktop, or web browser. Basic Playback Controls - Play, pause, and skip tracks within shuffle limitations. Discover Weekly & Release Radar - Stay updated with custom playlists for new music. Download: Spotify 1.2.66.445 | ARM64 | ~100.0 MB (Free, paid upgrade available) View: Spotify Website | Web Player Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • Understandable, they need to make money somehow to keep the service "free". If you're not paying with money, you'll pay with something else. In this case, it's ads. People will bitch about this (as usual), but it's basic economics, everything has a price, like YouTube (non-premium).
    • A sign of a man with absolutely no taste. Also the first American president to whine about American "jobs" while selling Chinese stuff for 5x or 10x the actual worth while slapping his stupid name on it. Like, what even is this, some really bad, humorless parody? Nope, it's the actual reality. Selling Chinese bible, selling EV's on White House front yard, selling Chinese phones that are wrapped in few microns of gold for 3x the value... It's so hilarious it's cringy af.
  • Recent Achievements

    • Week One Done
      patrickft456 earned a badge
      Week One Done
    • One Month Later
      patrickft456 earned a badge
      One Month Later
    • One Month Later
      Jdoe25 earned a badge
      One Month Later
    • Explorer
      Legend20 went up a rank
      Explorer
    • One Month Later
      jezzzy earned a badge
      One Month Later
  • Popular Contributors

    1. 1
      +primortal
      637
    2. 2
      ATLien_0
      278
    3. 3
      +FloatingFatMan
      171
    4. 4
      Michael Scrip
      156
    5. 5
      Steven P.
      128
  • Tell a friend

    Love Neowin? Tell a friend!