Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Sep 2009
    Posts
    22
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Tabs v3 not loading until after the rest of the page

    Hi,

    I'm trying to incorporate a set of tabs on a site that calls several things remotely, so it takes a few seconds to load. The thing is, the tabs show up (messily) as a typical unordered list, and don't "transform" into tabs until the very end of the page. I think I've come across what might be a solution at this address:

    http://stackoverflow.com/questions/1...l-then-as-tabs

    But I tried applying the solution suggested by Greg, and I can't seem to get it to work. Can anyone clarify his instructions? Maybe I'm doing it wrong or in the wrong place? I assume it's right at the beginning since that's where the tabs are, so mine looks like:

    Code:
    <div id="tabs" class="ui-tabs"><ul class="ui-tabs-nav">
    But nothing. Is there any way to just force everything to load right away?

    BTW - I'm working on a local WordPress install, but I could easily upload this to my site if anyone needs a visual to help me out - just let me know. Thanks in advance.

  • #2
    Senior Coder rangana's Avatar
    Join Date
    Feb 2008
    Location
    Cebu City, Philippines
    Posts
    1,752
    Thanks
    65
    Thanked 372 Times in 365 Posts
    Please provide link to your current progress
    Learn how to javascript at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph

  • #3
    New Coder
    Join Date
    Sep 2009
    Posts
    22
    Thanks
    6
    Thanked 0 Times in 0 Posts
    I've uploaded what I've got so far to http://www.thetanooki.com/test/

    The tab section is in the right sidebar. You'll notice it'll just appear as text in a list format for the first few seconds, and then only after everything else loads (particularly the Google ads and AddThis scripts) does the tabbed widget actual turn into tabs.

    I've added the classes I mentioned in my first post, and it makes no difference.

  • #4
    Senior Coder rangana's Avatar
    Join Date
    Feb 2008
    Location
    Cebu City, Philippines
    Posts
    1,752
    Thanks
    65
    Thanked 372 Times in 365 Posts
    You can hide tabs-2 and tabs-3 first using "display:none", and when the DOM loads, you can "show" it:
    Code:
    $('#tabs-2').show();
    $('#tabs-3').show();
    Learn how to javascript at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph

  • Users who have thanked rangana for this post:

    cponte (03-03-2010)

  • #5
    New Coder
    Join Date
    Sep 2009
    Posts
    22
    Thanks
    6
    Thanked 0 Times in 0 Posts
    Thanks for that. Hiding content was also suggested on that other site I linked to, but I'd prefer to see if there's a way I can load the CSS sooner or force the DOM to load quicker (I'm not too experienced with jQuery or Javascript, so I don't know if that's possible).

    The hiding thing works, but it just looks messy without the styles.

  • #6
    Senior Coder rangana's Avatar
    Join Date
    Feb 2008
    Location
    Cebu City, Philippines
    Posts
    1,752
    Thanks
    65
    Thanked 372 Times in 365 Posts
    The best function jQuery has that I can think of is by using ready() function which fires just when the DOM becomes ready.

    For more info, please check this article:
    http://api.jquery.com/ready/
    Learn how to javascript at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph

  • Users who have thanked rangana for this post:

    cponte (03-07-2010)


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •