首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Scrollspy不工作

Scrollspy不工作
EN

Stack Overflow用户
提问于 2013-04-24 03:23:39
回答 1查看 189关注 0票数 0

我得到了这段代码,不管我怎么做,scroll间谍都不会工作,有人能给我一些启发吗?提前感谢!

代码语言:javascript
复制
<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>
EN

回答 1

Stack Overflow用户

发布于 2013-12-05 03:36:36

这将很难解决,因为您只提供了div的标记。考虑链接到jsfiddle,这样我们就可以了解完整的情况。

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

代码语言:javascript
复制
    <script src="//netdna.bootstrapcdn.com/bootstrap/3.0.2/js/bootstrap.min.js"></script>

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

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/16177557

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档