Giter Club home page Giter Club logo

Comments (8)

ginsterbusch avatar ginsterbusch commented on July 20, 2024

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.

FlyingDR avatar FlyingDR commented on July 20, 2024

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.

FlyingDR avatar FlyingDR commented on July 20, 2024

Error is same, located here

from smartmenus.

vadikom avatar vadikom commented on July 20, 2024

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.

FlyingDR avatar FlyingDR commented on July 20, 2024

Here is actual example from the project, I'm currently working on:
menu
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.

ginsterbusch avatar ginsterbusch commented on July 20, 2024

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.

vadikom avatar vadikom commented on July 20, 2024

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 &amp; 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.

FlyingDR avatar FlyingDR commented on July 20, 2024

Thank you for advice, I will try it. Closing this issue for now.

from smartmenus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.