Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Active tab by URL #13

Open
levipadre opened this issue May 8, 2014 · 2 comments
Open

Active tab by URL #13

levipadre opened this issue May 8, 2014 · 2 comments

Comments

@levipadre
Copy link

Hello,

The plugin is really nice and usable. I have a question. Is there any chance to use this plugin with callable url? For example, when the url like this:
domain/something/#tabId2
and the second tab will be the active tab.
I hope it's possible, I don't want to change to other.

Thanks a lot,
L

@rjmccollam
Copy link

@levipadre have you found a solution for this?

Even if there was a work around in applying the same class for the main navigation tabs. This plugin needs this functionality.

@rjmccollam
Copy link

This is by no means a pretty way to do this, but it got the job done for me for what I needed it for and it might help you or someone else.

  1. Target the class or ID of the link you want to switch to a new tab
  2. Set a general selector for your main tabs and set your selector for the specific tab that will become active. This will toggle the active class so when your link is clicked it changes just as if you clicked on the tab itself.
  3. Set a general selector for your individual tab content wrappers and the ID of the tab that you want to make show. This will handle the transition.

This was thrown together very quickly and for how I needed it to work, but hopefully it gives an idea on how you can get it working.

$('.next').click(function() {
        $('#tabs ul li a').removeClass('tabulous_active');
        $('#tabs ul li:nth-of-type(2) a').addClass('tabulous_active');
        $('#tabs_container div').removeClass('showscale').addClass('make_transist').addClass('hidescale');
        $('#tabs-2').addClass('make_transist').addClass('showscale');
    });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants