Comments (8)
So what you are trying to say is, when you create a structure like this:
<div class="my-menu">
<ul>
<li><div class="my-submenu">
<ul>
<li><a href="#">Item 1</a></li>
<li><a href="#">Item 2</a></li>
...
</ul></div></li>
</div>
.. then the script falls apart?
Cause I had some hard time understanding your text.
cu, w0lf.
from smartmenus.
Sorry for that, I would need to add better example.
Yes, it is exactly what I mean, in a case if submenu is not a simple <ul>
, but additionally wrapped in <div>
- I get JavaScript error: TypeError: par.parentNode is null
in this line. Additionally there is multiple TypeError: Cannot read property 'css' of null
errors in this place, but it seems to be consequences of previous error.
However I've just realized that there is newer version (0.9.7 is what came from Bower install), I will check with latest 1.0.0-beta and will let you know.
from smartmenus.
Error is same, located here
from smartmenus.
Yes, that's a requirement for now - i.e. you need to nest the sub UL element directly in the parent item's LI element. Are you sure there is no way to structure properly your HTML code if you follow this rule? Could you please post some sort of sample (demo URL would be best)?
from smartmenus.
Here is actual example from the project, I'm currently working on:
as you can see - submenu block contains not only menu items, but also several images. I've tried to imagine how to implement it using single <ul>
without additional wrapper but found no solution. Hence I decide that it may be good idea for improvement for this, actually very good, product.
from smartmenus.
So he's doing what I already suspected - trying to use smartmenus.js for a mega dropdown.
Which would indeed be cool ;)
cu, w0lf.
from smartmenus.
It's not a problem to create a mega drop-down with whatever HTML you like inside. You just need to use the proper structure supported by the script - here is a sample mega dropdown sub menu (a live sample is also included in the default demo in the download package):
...
<li><a href="#">Jewelry & Watches</a>
<ul class="mega-menu">
<li>
<!-- The mega drop down contents - put whatever HTML you like here -->
</li>
</ul>
</li>
...
So inside that mega drop-down you could include more lists of links, images, columns whatever you like.
Here is also a topic in the forums with some sample code that creates columns of links inside a mega drop-down:
http://www.smartmenus.org/forums/topic/mega-drop-down/
from smartmenus.
Thank you for advice, I will try it. Closing this issue for now.
from smartmenus.
Related Issues (20)
- Menu Z Index question. HOT 2
- Google SEO 2022: Complete SEO Beginner's Guide
- Pay Per Click vs. Search Engine Optimization
- On-Page vs Off-Page SEO: What's the Difference?
- please add new tag
- A11y: menu toggle button needs a :focus halo HOT 2
- A11y: ESC key should dismiss expanded menu HOT 1
- Second click on link not functional on Bootstrap 5 HOT 1
- A11y: submenus should not open/close on focus HOT 2
- A11y: replace span subIndicator with button HOT 2
- eval of user controlled data? HOT 6
- please add support bootsrap 5 HOT 8
- fix warning
- A11y: add role="button" to span subIndicator HOT 1
- a11y: move the <span> subindicator outside the menu link anchor tag
- [A11Y] aria-current on active menu item HOT 1
- SmartMenus should log errors to console, not use `alert()` HOT 2
- Question about SmartMenus 2 initialization HOT 2
- Programmatically open/hide SmartMenus 2.0 HOT 1
- Open page on pages with sub-links HOT 1
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 smartmenus.