<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>tabs</title><link
href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/flick/jquery-ui.css"
rel="stylesheet" type="text/css"></link><script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script><script
src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js"
type="text/javascript">
</script>
<SCRIPT>
$(function() {
$( "#tabs" ).tabs();
});

function on_list(key){

}
</SCRIPT>
</head><body>
<DIV class=demo>
  <a href="#" onClick="on_list(1); return false;">链接一</a><br />
<a href="#" onClick="on_list(2); return false;"> 链接二</a><br />
<a href="#" onClick="on_list(3); return false;">链接三</a>
<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>
<P>Proin elit arcu, rutrum commodo.</P></DIV>
<DIV id=tabs-2>
<P>Morbi tincidunt, dui sit amet facilisis feugiat.</P></DIV>
<DIV id=tabs-3>
<P>Mauris eleifend est et turpis. Duis id erat.</P>
<P>Duis cursus. Maecenas ligula eros, blandit nec, pharetra at, semper at, magna. Nullam ac lacus.</P>
</DIV>
</DIV>
</DIV><!-- End demo -->
</body>
</html>

解决方案 »

  1.   

    jqueryObj.tabs( "select" , index )Select a tab, as if it were clicked. The second argument is the zero-based index of the tab to be selected or the id selector of the panel the tab is associated with (the tab's href fragment identifier, e.g. hash, points to the panel's id).
    方法参考
      

  2.   

    jqueryObj.tabs( "select" , 可以是索引数字也可以是目标的#ID )