douxian1939 2009-05-31 17:14
浏览 93
已采纳

打开预选选项卡的页面,这不是第一个选项卡

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

This maybe a link from another page or a link from a page in the same frameset.

Under the covers everything is PHP.

  • 写回答

4条回答 默认 最新

  • doujupa7567 2009-05-31 17:20
    关注

    You'll want to select a tab on the initial load of the page through JavaScript. Here's 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>
    

    Where the index variable is the integer of the tab you want to have selected. It is 0 based, so if you want the third tab selected, you'll want to specify 2 for index.

    You'll want to do this once the page is ready:

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

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 用matlab 设计一个不动点迭代法求解非线性方程组的代码
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler
  • ¥15 oracle集群安装出bug
  • ¥15 关于#python#的问题:自动化测试