Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

jquery sub menu won't toggle

Featured Replies

Hello again,

 

I've designed a jquery menu using nested ul lists. This is in share point so the classes are all the same name, (including ul tags and li tags, so I can't change these names which is really frustrating.

 

Anyway here's the code

 
    <ul id='zz13_RootAspMenu'>
        <li class='static'>
              menu text
           <ul class='static'>
                 <li class='static'>
                      Sub menu text
                  </li>
             </ul>
          </li>
      </ul>
 
I've tried a couple of ways to toggle the sub menu text here they are:
 
[code]
       
          $('#zz13_RootAspMenu').bind('hover', function (e) {
               if($(this).children('ul.static li.static').length =0){      
                        return false;
                 }
                 else{
                       $(this).children('#zz13_RootAspMenu li.static').slideToggle();
                        return false;
                  }    
           });
 
 
                     $(function() {
                           $('#zz13_RootAspMenu li ul').on('hover', function(e) {
                                         e.stopPropagation();
                                         $(this).children().slideToggle();
                              });
                       });
 
                    
     [/code]      

These are only two of the many combinations I've tried. Whenever I try to add a level, for example, #zz13_RootAspMenu li ul li ul, and so on nothing happens.

 

Can anyone help?

 

 

 

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.