Tabs "Jump To" Button
Tabs "Jump To" Button
I am trying to have buttons within a tab to jump to a different tab, but get the following error:
Error: cannot call methods on tabs prior to initialization; attempted to call method 'enable'. Below is the code I tried. What is the correct way to implement this?
- <div id="tabs" >
- <ul>
- <li><a href="#tabs-1">Nunc tincidunt</a></li>
- <li><a href="#tabs-2">Proin dolor</a></li>
- <li><a href="#tabs-3">Aenean lacinia</a></li>
- </ul>
-
- <div id="tabs-1"> <input id="lnk" type="button" value="Jump to Tab 3" /> </div>
- <div id="tabs-2" > Tab2 </div>
- <div id="tabs-3" > Tab 3 </div>
- </div>
- <script>
- $(function() {
- $( "#tabs" ).tabs();
- });
-
- $(function(){
- $('#lnk').click(function() {
- $( "#tabs-3" ).tabs("enable");
- });
- });
-
- </script>