Comments (8)
This has been a popular request for a long time but due to the amount of complexity a bug-free implementation would add, I've resisted it. However, I have been working on adding support for non-iOS touch devices (iOS works fine already) and the solution I have in mind seems to dovetail nicely with the click feature. So standby.
from superfish.
You can now set the useClick
option to true
(new in v1.5.2). Just be aware that the links you click to open submenus will never be followed (unless you are navigating via the tab key). You could add a link to their submenus going to the same place, if this matters to you.
from superfish.
Thanks, Joel.
From: joeldbirch [mailto:[email protected]]
Sent: Wednesday, February 13, 2013 10:29 AM
To: joeldbirch/superfish
Cc: Bill Young
Subject: Re: [superfish] Feature request: (#2)
You can now set the useClick option to true (new in v1.5.2). Just be aware that the links you click to open submenus will never be followed (unless you are navigating via the tab key). You could add a link to their submenus going to the same place, if this matters to you.
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/2#issuecomment-13499152.
from superfish.
Sorry, I jumped the gun a bit. The useClick
function is unreliable on all IE versions (7–10). Submenus often begin to open but then close almost straight away. Consider this an alpha feature for now.
from superfish.
Sorry to comment on a closed issue, but have you considered making the menu work the way that the first click opens a submenu and the second one follows the link? For an avarage user this might be the most logical way of operating.
I have myself implemented it to a menu for mobile browsers with jQuery. First time when you click the menu, check that if the submenu is already visible. If it is not, open it and close all the other submenus. If it is, then follow the link.
Any thoughts?
from superfish.
There are really two issues. One is useClick
which I have interpreted to be clicking anchors to open and close associated submenus, and this is what this "issue" thread is about. The other is supporting touch devices with the behaviour you described. Maybe we should open a new issue about touch support if you would like to discuss further. I'll add my thoughts here for now, though:
Your idea is very similar to what is already in the latest versions of Superfish, but I am seeing issues with various Android browsers (pre-Chrome default browser in Android v4.x, Firefox, Opera). Often (though not always!) the problem browsers fire the list item's mouseenter
event before the anchor's click
event, causing the submenu to be technically open by the time click
event fires. This causes the link to be followed on first tap in those browsers. I have verified this as the cause in the pre-Chrome v4.x default browser (although it works fine in Gingerbread 2.3.x due it seemingly not having mouse events, which is great), but I'm not sure it's the same cause in Firefox and Opera (but it's likely). Need to do more testing.
So, currently the two browsers Superfish works flawlessly in are Chrome for Android and the default Gingerbread browser. This covers a fair percentage of Android users, but nowhere near enough. I haven't even had access to a Windows Surface or Windows Phone, yet.
Back to the technicalities of the solution. The flag I am setting to determine if the tap should follow the link or not is less direct than your idea of "is the submenu visible". I'm interested to try your version, now.
My solution involves changing a boolean follow
variable on the anchor to true
upon mouseenter
(for mouse navigation) and focusin
(for keyboard navigation). Worked okay in the mobile browsers I tested…until I tested the browsers that fire mouseenter
even though it's a touch device. I can think of reasons why they would want to do that, but it certainly complicates my solution. Maybe checking to see if the submenu .is(':visible')
will improve things, somehow?
Thanks for the suggestion. Let's start a new issue (and link back to this one) if you want to talk more about this.
from superfish.
This is solved in v1.5.4. Now works perfectly in all Android browsers I can get my hands on.
- All pre-Chrome default Android browsers.
- Chrome for Android
- Firefox for Android
- Opera Mobile for Android
Thanks for the inspiration, Luoti.
from superfish.
No problem! :D Thank you very much for this feature!
from superfish.
Related Issues (20)
- SuperfishForSharePoint HOT 1
- Mobile menu not working 🤔 HOT 1
- jQuery easing animation support
- Way to disable all delays and animations HOT 2
- On Mobile (Google Pixel) on wordpress, selecting a submenu opens and rapidly closes the submenu HOT 1
- v1.7.9 confict with WooCommerce single product tabs navigation HOT 1
- issues with jquery 3.2.1 HOT 3
- onShow triggered again when clicking menu
- how to initialize superfish using javascript HOT 1
- Swiping to scroll opens submenu
- mouseenter targets vs focusin targets HOT 2
- On mobile submenus not showing HOT 1
- Superfish doesn't work correctly
- Close the current submenu by using escape HOT 5
- iPad ios 13.1 menu item link problem HOT 17
- Busted link in the README HOT 1
- jQuery Superfish Menu Plugin
- Homepage implies it contains examples, on their own page
- jQuery(...).superfish is not a function HOT 2
- Is there a support for accessibility for using this menu library. looking for aria-expanded attribute usage in this menu
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from superfish.