Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/84.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 引导:粘贴&x2B;旋转木马&x2B;间谍不能正常工作_Jquery_Twitter Bootstrap_Affix - Fatal编程技术网

Jquery 引导:粘贴&x2B;旋转木马&x2B;间谍不能正常工作

Jquery 引导:粘贴&x2B;旋转木马&x2B;间谍不能正常工作,jquery,twitter-bootstrap,affix,Jquery,Twitter Bootstrap,Affix,我开发了一个新网站()。我试着用引导脚本(scrollspy、carousel、affix)来实现它。但是,“粘贴”在Safari和Chrome中无法正常工作: 我的页面是 -标题 -旋转木马 -#品牌菜单(粘贴) -登录页内容 作为: … … … … //制作旋转木马 $('旋转木马').carousel(); //scrollspy(159是粘贴的#品牌菜单的高度) $('#menu').scrollspy({offset:159}); //滚动到登录页项目 $(“#品牌菜单”)。滚动

我开发了一个新网站()。我试着用引导脚本(scrollspy、carousel、affix)来实现它。但是,“粘贴”在Safari和Chrome中无法正常工作:

我的页面是 -标题 -旋转木马 -#品牌菜单(粘贴) -登录页内容 作为:


… 
…
… 
…
//制作旋转木马
$('旋转木马').carousel();
//scrollspy(159是粘贴的#品牌菜单的高度)
$('#menu').scrollspy({offset:159});
//滚动到登录页项目
$(“#品牌菜单”)。滚动_navi();
//当滚动隐藏#旋转木马时,粘贴品牌和菜单
$(“#品牌菜单”)。粘贴({偏移量:{顶部:$(“#旋转木马”)。高度(),底部:0});
结果:

并且在Chrome的开发者工具中查看错误控制台,您将看到其他错误。
<body>
    <header>
        <!-- height : $(window).height() - $("#brands-menu").height() (before scripts) -->
        <section id="carousel">
        </section>

        <!-- height : 159px, to affix -->
        <div id="brands-menu">
            <div id="brands">
                … 
            </div>
            <nav id="menu">
                …
            </nav>
        </div> 
    </header>
    <section>
        … 
    </section>
    …
    <script>
        // make carousel
        $('#carousel').carousel();

        // scrollspy (159 is the height of affixed #brands-menu)
        $('#menu').scrollspy({ offset:159 });

        // to scroll to landing page items
        $('#brands-menu').scroll_navi();

        // affix brands and menu, when scroll hides #carousel
        $("#brands-menu").affix({ offset:{top:$("#carousel").height(), bottom:0}});
    </script>
</body>