Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/81.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery 链接到选项卡中包含的手风琴部分?_Jquery_Twitter Bootstrap 3_Tabs_Accordion_Nav - Fatal编程技术网

Jquery 链接到选项卡中包含的手风琴部分?

Jquery 链接到选项卡中包含的手风琴部分?,jquery,twitter-bootstrap-3,tabs,accordion,nav,Jquery,Twitter Bootstrap 3,Tabs,Accordion,Nav,我是一个相对较新的网络开发人员,因此,我遇到了我的第一个主要头痛。对,我试图通过锚定标签访问手风琴中的内容,但是手风琴位于一组标签中。锚定标记位于my index.php的页脚内。所有这些功能都由Bootstrap 3方便地提供 基本上,我已经解决了这个问题,并且使用StackOverloow解决了问题中的链接到选项卡的部分,我使用这个脚本完成了这项工作 $(window).load(function() { // cache the id var navbox = $('

我是一个相对较新的网络开发人员,因此,我遇到了我的第一个主要头痛。对,我试图通过锚定标签访问手风琴中的内容,但是手风琴位于一组标签中。锚定标记位于my index.php的页脚内。所有这些功能都由Bootstrap 3方便地提供

基本上,我已经解决了这个问题,并且使用StackOverloow解决了问题中的链接到选项卡的部分,我使用这个脚本完成了这项工作

$(window).load(function() { 

    // cache the id
    var navbox = $('.nav-tabs');

    // activate tab on click
    navbox.on('click', 'a', function (e) {
      var $this = $(this);
      // prevent the Default behavior
      e.preventDefault();
      // send the hash to the address bar
      window.location.hash = $this.attr('href');
      // activate the clicked tab
      $this.tab('show');
    });

    // will show tab based on hash
    function refreshHash() {
      navbox.find('a[href="'+window.location.hash+'"]').tab('show');
    }

    // show tab if hash changes in address bar
    $(window).bind('hashchange', refreshHash);

    // read has from address bar and show it
    if(window.location.hash) {
      // show tab on load
      refreshHash();
    }