openam / bootstrap-responsive-tabs

Bootstrap responsive tabs are tabs that switch to collapsible components (accordions) when resized.
openam.github.io/bootstrap-responsive-tabs
MIT License
132 stars 60 forks source link

text-decoration: none; not working #1

Closed Allmedialab closed 10 years ago

Allmedialab commented 10 years ago

Hi, I implemented your script, but can't get rid of the underscores of the responsive links. Do you know how to do that!? Thanks in advance! Nice work!!!! David The HTML:

    <li class="active"><a href="#home" class="deco-none" data-toggle="tab">Web</a></li>
    <li><a href="#print" class="deco-none" data-toggle="tab">Print</a></li>
    <li><a href="#vid" class="deco-none" data-toggle="tab">Video</a></li>
     <li><a href="#hdr" class="deco-none" data-toggle="tab">HDR foto's</a></li>
     <li><a href="#hosting" data-toggle="tab" class="deco-none">Hosting</a></li>

The CSS:

} .deco-none { text-decoration: none !important; }

Allmedialab commented 10 years ago

Thanks a lot! Works perfect!

For other people with the same question the answer is: add the CSS class to responsive-tabs.js line 43: 'class' : 'accordion-toggle deco-none',

openam commented 10 years ago

Glad it worked for you, but you shouldn't have to modify the js file. The feature that i added in the commit that closed this makes it so that you can just add the class to the <a> in the original markup and it will copy it to the accordion.

If you look at the updated demo. I added the deco-none class to the first (How To) and third (Source) tabs, but not the second (Key Features). The class is copied to the accordion and you can see the difference with the mouse over in the demo.

Spunkie commented 10 years ago

To follow this issue up because I feel it's related.

I'm using jquery to do jQuery(".logout_li").show(); and jQuery(".logout_li").hide(); on the tab <li> so you end up with <li class="logout_li" style="display: none;">. When the tabs are converted to accordions it ignores the display:none and shows every tab and it does not pull over the classes from the <li> tags.

Would it be possible to have it pull over the classes from the <li> tags and respect style="display: none;"?

openam commented 10 years ago

@Spunkie I don't think that I'll add support to copy the style="" attribute over. I could add support to copy the li classes over. Which would work for you if you used something like jQuery(".logout_li").addClass("hidden") and jQuery(".logout_li").removeClass("hidden").

I haven't figured out where the best place to copy the <li> classes to. When it generates the accordion it generates 2 nested <div>s and an <h4>. It may make sense to copy it from the <li> to the most outer <div>. It would have to ignore several classes, e.g. active.

Does that seem like a reasonable approach? If so could you open a new issue.

Spunkie commented 10 years ago

That sounds like it would work fine for me although my actual code looks like this

<li class="logout_li"><a href="#logout_modal" data-toggle="modal"><i class="icon-user"></i>
    Logout
</a></li>

So for me the active class is not really an issue since it triggers a modal and never gets applied to the <li>. So I don't have any opinions on how that would best be handled. That said I really like how your script handles this and just pulls in the modal content into the accordion, super fancy.

I've opened up a new issue @ #2