Search code examples
javascriptjqueryhtmljquery-uigoogle-cdn

jQuery UI not working? (Specifically tabs)


Odd problem. I've looked at some similar questions- None of their answers fixed my problem.

It's doing all the stuff right but rather than the tabs becoming interactive like they're meant to, they just all show.

I'm leaving out as much unnecessary code as possible, including my decorative CSS.

Feel free to ask me for additional information. Thanks for viewing.

Here's my header file:

<link rel="stylesheet" type="text/css" href="/Include/styleSheetV2.css"/>
<link rel="stylesheet" type="text/css" href="/Include/StyleSheet.CSS"/>
<link type="text/css" href="http://jqueryui.com/latest/themes/base/ui.all.css" rel="stylesheet"/>
<script type="text/javascript" src="https://www.google.com/jsapi?key=(Removed key for StackOverflow)"></script>

<script type="text/javascript" src="/JSFunctions.js"></script>
<script type="text/javascript">
google.load("jquery", "1.6.4");
google.load("jqueryui", "1.8.16");
</script>

This is the HTML code

<div id="prof_div" class="sG_tabber">
    <ul class="sG_tabberNav">
        <li><a href="#prof_home">Profile Home</a></li>
        <li><a href="#prof_details">Details</a></li>
        <li><a href="#prof_settings">Settings</a></li>
    </ul>
    <div id="prof_home" class="sG_tabberTab">
        1   
    </div>
    <div id="prof_details" class="sG_tabberTab">
        2
    </div>
    <div id="prof_settings" class="sG_tabberTab">
        3
    </div>
</div>
<script type="text/javascript">
    $(document).ready(function() {  
        $('#prof_div > ul').tabs({ 
            fx: { height: 'toggle', opacity: 'toggle' } 
        });
    }); 
</script>

And here's my CSS code (Only the necessary bit)

.ui-tabs-hide {  
    display: none;
}

Solution

  • Try using $("#prof_div").tabs() not #prof_div > ul