Hello,
I am using tabs from queryui.com/tabs.Tab is working fine.Now i needs an additonal thing that is
1. Go to the next tab on button click
How to achieve the above result ??
This way
<link rel="stylesheet" href="http://code.jquery.com/ui/1.8.3/themes/base/jquery-ui.css" /> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> <script type="text/javascript" src="http://code.jquery.com/ui/1.8.3/jquery-ui.js"></script> <link rel="stylesheet" href="/resources/demos/style.css" /> <script type="text/javascript"> var currentTab = 0; $(function () { $("#tabs").tabs({ select: function (e, i) { currentTab = i.index; } }); }); $("#btnNext").live("click", function () { var tabs = $('#tabs').tabs(); var c = $('#tabs').tabs("length"); currentTab = currentTab == (c - 1) ? currentTab : (currentTab + 1); tabs.tabs('select', currentTab); }); </script> <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"> Tab 1 </div> <div id="tabs-2"> Tab 2 </div> <div id="tabs-3"> Tab 3 </div> </div> <input type="button" id="btnNext" value="Next Tab" />
Demo
© COPYRIGHT 2024 ASPSnippets.com ALL RIGHTS RESERVED.