Git Product home page Git Product logo

Comments (12)

cpsrac avatar cpsrac commented on July 20, 2024

I had the same issue at the start, I changed the order my scripts loaded, presto no more multiple tabs showing. I am running the website locally currently, and I expect once upload to the data-center it should function the same, if there is a timing issue in the loading of the scripts, I will simply reorder the loading of the scripts.

script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.js" type="text/javascript"></script>
script src="js/jquery-ui-1.8.13.custom.min.js" type="text/javascript"></script>
script src="js/jquery.easytabs.js" type="text/javascript"></script>
script type="text/javascript">$('#outer-container, #inner-container').easytabs();</script>
script src="js/jquery.hashchange.min.js" type="text/javascript"></script>

I tested for about 5 min flipping tabs outer and inter and couldn't cause the error again once I changed the script order.

Richard...

from jquery-easytabs.

graphicDev avatar graphicDev commented on July 20, 2024

Thanks for you answer.

It's definitely haschange.min.js that messes it up. I tried reordering the loading of the scripts, placing haschange.min.js last. I think it helped at first - the problem occurred less often, but it did happen sometimes. Now, it happens all the time. Not sure what I did. The HTML is 100% correct according to W3C HTML Validator and the jQuery seems correct as well...

I tried removing all other scripts, but the problem remains.

Finally, I removed haschange.min.js and disabled updateHash, which solved the problem, but it's still an issue since I would rather have it enabled... :/

from jquery-easytabs.

jamenzin avatar jamenzin commented on July 20, 2024

Hi,

If you change line 313, which is currently this:

if ( hash === '' || plugin.matchTab(lastHash).length || $container.closest(hash).length ) {

to

if ( hash === '' || plugin.matchTab(lastHash).length) {

The problem will go away (at least on my end). Say you have top-level tabs A and B, and B has nested tabs C and D. If you navigate to B and select a non-default tab (in this case, D), go back to A, and then go to B again, you'll see the content of the non-default tab (D) placed below the content in the default tab (C). Changing the code to keep the existing selection in the sub-tabs and not automatically move back to the default tab fixes the problem (and also is the behavior that I'd like).

from jquery-easytabs.

JangoSteve avatar JangoSteve commented on July 20, 2024

@jamenzin I understand what you're saying, the problem is that breaks back-button functionality for the first tab. I.e. you load the page, click tab B, then click back... nothing would happen.

from jquery-easytabs.

jamenzin avatar jamenzin commented on July 20, 2024

Hm, what you're saying seems to be true for the inner tabs, but the outer tabs still work. What if you make it so the hash is updated to the current tab when you enter the inner tabs?

from jquery-easytabs.

JangoSteve avatar JangoSteve commented on July 20, 2024

Not sure I follow. If I made the change you suggested then the outer tabs wouldn't work either for what I just described.

from jquery-easytabs.

jamenzin avatar jamenzin commented on July 20, 2024

Checking for nested tabs and manually hiding the active tab in this section of code seems to work. I see what you're saying about the back button functionality, etc., but we need some sort of workaround so content doesn't flow into the wrong pages (otherwise we can't use hashchange). There are probably better ways to do this with other EasyTabs functions as well. Thoughts?

        if ( hash === '' || plugin.matchTab(lastHash).length || $container.closest(hash).length ) {
          var subTabs = $(hash).find('[data-easytabs=true]');
          if (subTabs) {
            subTabs.find('div.' + settings.tabActiveClass).css('display', 'none');
          }
          skipUpdateToHash = true;
          plugin.selectTab( $defaultTabLink );
        }

from jquery-easytabs.

websnail avatar websnail commented on July 20, 2024

Experienced the same issue today and despite the suggested code above, still get the same issues..

One thing I'm unsure about is whether the code above will work given that there doesn't appear to be any indication of which tab-container is being referred to. I suspect that's more down to my lack of experience with Jquery & JS though.

Has anyone had any further thoughts on this problem?

from jquery-easytabs.

fcaceres avatar fcaceres commented on July 20, 2024

I am experiencing the same problems, I will try jamenzin suggestion. I will post here if it worked or not.

from jquery-easytabs.

fcaceres avatar fcaceres commented on July 20, 2024

I figured out a quick workaround that works like a charm, very simple and makes it work great. I know this is my first idea to fix the problem. I am sure that I will figure out something better eventually, but for all of you that have been breaking your heads trying to find the simplest workaround that works, here it is:

$('#nested-tab-3').click(function(){
  window.setTimeout('location.reload()', 500); 
});

Just do that with any selector that has nested tabs.

Fred.

from jquery-easytabs.

manepane avatar manepane commented on July 20, 2024

hey,
i am new to this blog guys and i am facing the same problem.
does anyone figure out any solution ?
regarding fcaceres solution : i tried to put it in my code but it didn't work :(

Can anyone help me with this ?

from jquery-easytabs.

zeldaboch avatar zeldaboch commented on July 20, 2024

same here... =( but i can't help, i'm a complete noob in jquery coding

from jquery-easytabs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.