0

I'm following this: http://getbootstrap.com/2.3.2/javascript.html#dropdowns

1) It says: To keep URLs intact, use the data-target attribute instead of href="#". and then href="/page.html". I assume /page.html refers to the page you're currently on. Is that true? I'm using rails, and I have the dropdown code on a page that has a different url depending on what colleges page you're visiting. So what would I put for the href then? Would it be easier to just forget it and just use href="#"?

2) It doesn't explain what to put inside here:

  <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
    ...
  </ul> 

Is it just the typical <li><a href="#"></a></li>?

4

1 回答 1

0
<li class="dropdown">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown">Genres</a>
                <ul class="dropdown-menu">
                  <li><a href="/tag/pop">Pop</a></li>
                  <li><a href="/tag/rock">Rock</a></li>
                  <li><a href="/tag/dance">Dance</a></li>
                  <li><a href="/tag/electronic">Electronic</a></li>
                  <li><a href="/tag/soundtrack">Soundtrack</a></li>
                  <li><a href="/tag/classical">Classical</a></li>
                  <li><a href="/tag/alternative">Alternative</a></li>
                  <li><a href="/tag/indie">Indie</a></li>
                  <li><a href="/tag/jazz">Jazz</a></li>
                  <li><a href="/tag/punk">Punk</a></li>
                  <li><a href="/tag/folk">Folk</a></li>
                  <li><a href="/tag/hard rock">Hard Rock</a></li>
                  <li><a href="/tag/hip-hop">Hip-Hop</a></li>
                  <li><a href="/tag/instrumental">Instrumental</a></li>
                  <li><a href="/tag/trance">Trance</a></li>
                  <li><a href="/tag/folk rock">Folk Rock</a></li>
                  <li><a href="/tag/fusion">Fusion</a></li>
                  <li><a href="/tag/rock n roll">Rock N Roll</a></li>
                  <li><a href="/tag/dubstep">Dubstep</a></li>
                </ul>
              </li>

你必须使用这样的代码

于 2013-08-11T07:46:00.423 回答