The tab start page is preselected, which is not the first tab

I have a page with jqueryui tabset. I would like to open a page with a tab other than the selected first tab. If I have four tabs on a page, I need to select any of the four to be open.

This can be a link from another page or links from a page in the same set of frames.

Under the covers is PHP.

+5
source share
4 answers

You need to select the page boot tab via JavaScript. Here is an example of how to select a tab:

http://docs.jquery.com/UI/API/1.7/Tabs#method-select

<script type="text/javascript">
  $(function() {
    $("#tabs").tabs( 'select' , index )
  });
</script>

, . 0, , , , 2 .

, :

http://www.learningjquery.com/2006/09/introducing-document-ready

+3

jQuery UI v1.10.0. API jQuery .

API: http://api.jqueryui.com/tabs/#option-active

:

$(".selector").tabs({ active: 1 });
+2

selected .

$("#tabs").tabs({
    selected: index //index of the tab to be preselected
});

, , - 0 ajax. , , select , ajax 0. , . selected .

+1

ui-tabs-selected <li>.

jQuery ,

  • selected
  • , location.hash hash <a>
  • , <li> ui-tabs-selected class
  • if you don’t try to select the first not disabled ( ui-state-disabled) tab

bit of the old question. answered since this page is the first in google

+1
source

All Articles