JangoSteve / jQuery-EasyTabs

Easy and flexible jQuery tabbed functionality without all the styling.
http://www.alfajango.com/blog/jquery-easytabs-plugin/
549 stars 203 forks source link

Disable tab by name #113

Open MaliniNandhu opened 11 years ago

MaliniNandhu commented 11 years ago

How can I disable a tab

pcopu commented 11 years ago

bump

JangoSteve commented 11 years ago

What exactly do you mean by disable the tab? Like make it so that when you click it, nothing happens? How about:

$('#some-tab').bind('click', function(e) {
  return false;
});
pcopu commented 11 years ago

I'm not sure what Malin means, but I'm trying to figure more control over an individual tab. I'm looking to create a custom home tab as a separate html element (outside of the ul) while still maintaining slide functionality. Currently, when I delete the homepage tab/list item, it disables the homepage as a tab. Or, when I apply some CSS to hide the tab/list item, it doesn't function well with my other other plugins.

Basically, I'm looking to "hide" a tab while still keeping a slide.

JangoSteve commented 11 years ago

The most straight forward thing I could think of would be to add display: none styling to the specific li for the one you want to hide. Then, your external button could just have something like:

$('#some-button').click(function(e) {
  $('#tab-container').easytabs('select', '#some-panel');
});

Is that what you're currently trying? If so, how does it mess up the other plugins?

pcopu commented 11 years ago

Yeah, that was my thinking. The problem currently is that I have another carousel plugin (caroufredsel) pulling the tab ul and turning that into a responsive carousel. Having a hidden list item breaks the carousel.

pcopu commented 11 years ago

Here's the dev site: http://obscuredevplatform.com/source/template/

JangoSteve commented 11 years ago

I noticed that with caroufredsel, you're doing this:

$(".menu .tabs").carouFredSel()

Does something like this not work?

$(".menu .tabs:visible").carouFredSel({
pcopu commented 11 years ago

Hmm, I did try that, nothing changed. I ended up keeping the home tab. I'd still be interested to know how it's done, but I guess CarouFredSel's documentation page/forum would be a better place to find that out. Thanks for the help all the same, much appreciated!