Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/85.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
我的html文件中隐藏的div_Html_Navigation_Google Chrome Devtools_Hidden - Fatal编程技术网

我的html文件中隐藏的div

我的html文件中隐藏的div,html,navigation,google-chrome-devtools,hidden,Html,Navigation,Google Chrome Devtools,Hidden,我目前正在使用scrollNav.js,在我将它与我的HTML融合后,我注意到在我的HTML中显示了一些额外的div 但是我只能通过GoogleDevTools(f12)检测到这个div。这可能吗 这是我的HTML文件: <section id="scrollNav-1" class="home scroll-nav_section"> <div class="container"> <div

我目前正在使用scrollNav.js,在我将它与我的HTML融合后,我注意到在我的HTML中显示了一些额外的div

但是我只能通过GoogleDevTools(f12)检测到这个div。这可能吗

这是我的HTML文件:

<section id="scrollNav-1" class="home scroll-nav_section">
                <div class="container">

                    <div class="tagline post-article">  <!--row1-->

                        <h2>HI !</h2>
                    </div>

你好
这是根据DevTools(f12)的div


滚动至视图中激活的项目
你好
*我现在的更新是,我可以通过在showheadline中键入False来删除“滚动到”,并通过设置display:none来删除所有其他div 变成这样:

但这不是我想要的结果。我希望它是一清二楚的,它从哪里来,以及如何克服它,而不是仅仅把它隐藏起来

<section id="scrollNav-1" class="home scroll-nav_section">
                <div class="container">

                    <nav class="scroll-nav fixed" role="navigation"><div class="scroll-nav__wrapper"><ol class="scroll-nav__list"><li class="scroll-nav__item active in-view"><a href="#scrollNav-1" class="scroll-nav__link">HI !</a></li></ol></div></nav><div class="tagline post-article">  <!--row1-->

                        <section id="scrollNav-1" class="scroll-nav__section"><h2>HI !</h2></section>
                    </div>

  • 你好
    剧本:

    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> 
        <script type="text/javascript" src="js/scrollNav/jquery.scrollNav.min.js"></script>
        <script>    
           $('.post-article').scrollNav({
                sections: 'h2',
                subSections: false,
                sectionElem: 'section',
                className: 'scroll-nav',
                showHeadline: false,
                showTopLink: false,
                topLinkText: 'Top',
                fixedMargin: 40,
                scrollOffset: 40,
                animated: true,
                speed: 500,
                insertTarget: this.selector,
                insertLocation: 'insertBefore',
                arrowKeys: false,
                scrollToHash: true,
                onInit: null,
                onRender: null,
                onDestroy: null
            });
    
        </script>
    
    
    $('.post-article').scrollNav({
    章节:“h2”,
    分段:错误,
    sectionElem:“section”,
    类名:“滚动导航”,
    标题:假,,
    showTopLink:false,
    topLinkText:'Top',
    修订日期:40,
    滚动偏移量:40,
    是的,
    速度:500,,
    insertTarget:this.selector,
    insertLocation:“insertBefore”,
    箭头键:false,
    是的,
    onInit:null,
    onRender:null,
    onDestroy:null
    });
    

    如何删除我甚至不知道它来自何处的额外div?

    额外div不是额外的。它是由您正在使用的scrollnav库创建的。许多插件和库在dom上创建额外的元素以添加它们的特性。没什么好担心的:)

    问题是我想删除其中的文本。我该怎么做?因为它在我的HTML文件中没有任何用处。它添加了其他不相关的文本。我怎样才能摆脱它?
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> 
        <script type="text/javascript" src="js/scrollNav/jquery.scrollNav.min.js"></script>
        <script>    
           $('.post-article').scrollNav({
                sections: 'h2',
                subSections: false,
                sectionElem: 'section',
                className: 'scroll-nav',
                showHeadline: false,
                showTopLink: false,
                topLinkText: 'Top',
                fixedMargin: 40,
                scrollOffset: 40,
                animated: true,
                speed: 500,
                insertTarget: this.selector,
                insertLocation: 'insertBefore',
                arrowKeys: false,
                scrollToHash: true,
                onInit: null,
                onRender: null,
                onDestroy: null
            });
    
        </script>