Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 137131
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T07:03:28+00:00 2026-05-11T07:03:28+00:00

I’m trying to build a simple multi-level UL Horizontal Accordion (or slide menu) in

  • 0

I’m trying to build a simple multi-level UL Horizontal Accordion (or slide menu) in Jquery. Hunter Daley graciously provided the Jquery code, but I can’t seem to figure out the css. I know this is newb, but I’m really stuck.

When Ul li Ul slides out it creates a linebreak, I’d like to have everything display inline, with no breaks. I’ve tried whitespace: nowrap, display inline etc It just won’t seem to do it. Any ideas?

As per, Glavic’s answer: I was trying to to use floats, but if I do Safari bugs out and flash the sub-level UL during the animation:

Using Floats:

Right, I was trying to do it without floats. I’m trying to stick with the animation function.

Safari bugs out and flashes the sub ul during the animation.

<style type='text/css'> <!-- body {   font-size: 1em;   line-height: 1em; } ul {   background-color: yellow;   list-style: none;   margin: 0;   padding: 0;   height: 1em;   float: left; } ul li {   background-color: aqua;   float: left; } ul li ul {   background-color: blue; } ul li ul li {   background-color: green; } a, a:link, a:hover, a:visited, a:active {   color: black;   text-decoration: none;   float: left; } --> </style> 

Original Post:

<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'> <head>     <meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>     <script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js'></script>      <title>untitled</title>        <style type='text/css'>     <!--     ul{          list-style: none;         background-color: yellow;         margin: 0;         padding: 0;                 white-space: nowrap;             }      ul li {         background-color: aqua;         display: inline;       }      ul li ul {          background-color: blue;               }       ul li ul li {         background-color: green;         }      a, a:link, a:hover, a:visited, a:active {             color: black;             text-decoration: none;      }     -->     </style>      <script type='text/javascript'>            var $current = null;         $(document).ready(function(){            $('ul li ul').hide(); // hide submenus by default on load             $('ul li a').click(function(){               var $sub = $(this).next();                if ($sub.css('display') == 'none')               {                  if ($current != null)                     $current.animate({ width: 'hide' }); // if you want to only show one sub at a time                  $sub.animate({ width: 'show' });                   $current = $sub;               }               else               {                  $sub.animate({ width: 'hide' });                  $current = null;               }            });         });      </script>  </head>  <body>     <ul>             <li>                     <a href='#'>Top-level 1</a>             </li>             <li>                     <a href='#'>Top-level 2</a>                      <ul>                             <li><a href='#'>Bottom Level A1</a></li>                             <li><a href='#'>Bottom Level A2</a></li>                             <li><a href='#'>Bottom Level A3</a></li>                             <li><a href='#'>Bottom Level A4</a></li>                     </ul>             </li>              <li>                     <a href='#'>Top-level 3</a>                     <ul>                             <li><a href='#'>Bottom Level B1</a></li>                             <li><a href='#'>Bottom Level B2</a></li>                     </ul>             </li>              <li>                     <a href='#'>Top-level 4</a>             </li>     </ul>   </body> </html> 
  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T07:03:29+00:00Added an answer on May 11, 2026 at 7:03 am

    If I understand you correctly you would like to have first and second menu level in one line (horizontal) ?

    Try this:

    <style type='text/css'>     ul{         list-style: none;         background-color: yellow;         margin: 0;         padding: 0;         float: left;     }     ul li {         background-color: aqua;         float: left;     }     ul li ul {         background-color: blue;     }     ul li ul li {         background-color: green;     }     a, a:link, a:hover, a:visited, a:active {         color: black;         text-decoration: none;         float: left;     } </style> 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have just tried to save a simple *.rtf file with some websites and
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
Does anyone know how can I replace this 2 symbol below from the string
this is what i have right now Drawing an RSS feed into the php,
That's pretty much it. I'm using Nokogiri to scrape a web page what has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.