0

This is doing my nut in and ruining my weekend.

I found this great expandable jquery vertical navigation menu. The problem is on other pages i have unordered lists and the unordered list style for the jquery vertical menu effects all the other unordered lists and i dont want that. The html and inline css etc is this..........

ul{list-style: none; padding: 0; margin: 0;}
#nav {float: left; width: 280px; border-top: 1px solid #999; border-right: 1px solid #999; border-left: 1px solid #999; margin: 15px 0;}
#nav li a {display: block; padding: 10px 15px; background: #ccc; border-top: 1px solid #eee; border-bottom: 1px solid #999; text-decoration: none; color: #000;}
#nav li a:hover, #nav li a.active {background: #999; color: #fff;}
#nav li ul {display: none;}
#nav li ul li a {padding: 10px 25px; background: #ececec; border-bottom: 1px dotted #ccc;}
      <ul id="nav">
    <li><a href="#">Item 1</a>
      <ul>
        <li><a href="#">Sub-Item 1 a</a></li>
        <li><a href="#">Sub-Item 1 b</a></li>
        <li><a href="#">Sub-Item 1 c</a></li>
      </ul>
    </li>
    <li><a href="#">Item 2</a>
      <ul>
        <li><a href="#">Sub-Item 2 a</a></li>
        <li><a href="#">Sub-Item 2 b</a></li>
      </ul>
    </li>
    <li><a href="#">Item 3</a>
      <ul>
        <li><a href="#">Sub-Item 3 a</a></li>
        <li><a href="#">Sub-Item 3 b</a></li>
        <li><a href="#">Sub-Item 3 c</a></li>
        <li><a href="#">Sub-Item 3 d</a></li>
      </ul>
    </li>
    <li><a href="#">Item 4</a>
      <ul>
        <li><a href="#">Sub-Item 4 a</a></li>
        <li><a href="#">Sub-Item 4 b</a></li>
        <li><a href="#">Sub-Item 4 c</a></li>
      </ul>
    </li>
  </ul>

i tried changing the css ul to #nav ul{list-style: none; padding: 0; margin: 0;} but this doesnt seem to work. please help this me out someone. cheers.

teddy

4

1 回答 1

0

通常,当您下载 JQuery 小部件或 thingamabob 时,它会出现在一个文件夹中,并附有有关如何使用它的示例!但我只是在这里猜测你没有直接从 JQuery UI 得到这个?

在任何情况下,尝试将您的菜单包装到一个 DIV 中,ID = "Nav"...

然后,您页面内的其他 UL 应继承您在上面声明的默认 ul 样式。

于 2013-03-10T00:58:15.613 回答