Scrollspy不工作

时间:2013-04-23 19:23:39

标签: scroll spy

我得到了这个代码,无论我做什么,滚动间谍都行不通,任何人都可以为它做些什么?提前谢谢!

<div class='corpo effect8'>
        <div class='esquerda'>
            <div id="como-nav" class='como-menu'>
                <div class="como-menu-topo">menu</div>
                <ul class="como-menu-links">
                    <li class><a href="#intro">introdução</a></li><div class="divisor-como"></div>
                    <li class><a href="#quemsomos">quem somos</a></li><div class="divisor-como"></div>
                    <li class><a href="#queremos">o que queremos</a></li><div class="divisor-como"></div>
                    <li class><a href="#coletadedados">coleta de dados</a></li><div class="divisor-como"></div>
                    <li class><a href="#ferramentas">ferramentas</a></li><div class="divisor-como"></div>
                    <li class><a href="#faq">FAQ</a></li>
                </ul>
            </div>
        </div>
        <div id="como-texto" class="comofunciona" data-spy="scroll" data-target="#como-nav" data-offset="0">
            <h3 id="intro">introdução</h3>
            <p>Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.</p>
            <h3 id="quemsomos">quem somos</h3>
            <p>Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.</p>
            <h3 id="queremos">o que queremos</h3>
            <p>Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.</p>
            <h3 id="coletadedados">coleta de dados</h3>
            <p>Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.</p>
            <h3 id="ferramentas">ferramentas</h3>
            <p>Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.</p>
            <h3 id="faq">faq</h3>
            <p>Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.</p>

        </div>

1 个答案:

答案 0 :(得分:0)

这很难排除故障,因为你只为div提供了标记。考虑链接到一个jsfiddle,这样我们就可以得到完整的图片。

当我遇到卷轴问题时,这是因为我把js代码放在头部而不是身体的底部。尝试放置

    <script src="//netdna.bootstrapcdn.com/bootstrap/3.0.2/js/bootstrap.min.js"></script>

(或正在使用的任何版本的BS)就在关闭body标签之前。