twbs / bootstrap

The most popular HTML, CSS, and JavaScript framework for developing responsive, mobile first projects on the web.
https://getbootstrap.com
MIT License
170.47k stars 78.83k forks source link

Bootstrap-tabs.js doesn't work with complex href. #740

Closed KendallHopkins closed 12 years ago

KendallHopkins commented 12 years ago

I've found some href that are identical to #*id*, but don't work due to the way the javascript is implemented.

Example #1: href contains absolute path to self.

<ul class="tabs" data-tabs="tabs">
    <li  class="active" ><a href="/bootstrap/demo#home"><span>Home</span></a></li>
</ul>
<div class="tab-content">
    <div id="home" class="active">
        <p>Raw denim you probably haven't heard of them jean shorts Austin. Nesciunt tofu stumptown aliqua, retro synth master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum iphone. Seitan aliquip quis cardigan american apparel, butcher voluptate nisi qui.</p>
    </div>
</div>

Example #2: href contains relative path to self.

<ul class="tabs" data-tabs="tabs">
    <li  class="active" ><a href="demo#home"><span>Home</span></a></li>
</ul>
<div class="tab-content">
    <div id="home" class="active">
        <p>Raw denim you probably haven't heard of them jean shorts Austin. Nesciunt tofu stumptown aliqua, retro synth master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum iphone. Seitan aliquip quis cardigan american apparel, butcher voluptate nisi qui.</p>
    </div>
</div>
fat commented 12 years ago

that is correct - you have to provide only a target id.

fat commented 12 years ago

in 2.0 you'll be able to optionally supply a data-target

KendallHopkins commented 12 years ago

Good stuff. That sounds like a nice solution.