Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/376.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
Javascript 2个div在使用另一个帐户重新登录后的奇怪行为_Javascript_Php_Jquery_Html_Css - Fatal编程技术网

Javascript 2个div在使用另一个帐户重新登录后的奇怪行为

Javascript 2个div在使用另一个帐户重新登录后的奇怪行为,javascript,php,jquery,html,css,Javascript,Php,Jquery,Html,Css,所以我一直在做这件事,遇到了一个严重的问题。当我清理所有缓存、会话和Cookie时,当我继续工作时 //to explain in plain text <div id="player_information">...here goes content...</div> <div id="contacts">....here goes content</div> 编辑2:回应@David Hoerster $("#main").click(fu

所以我一直在做这件事,遇到了一个严重的问题。当我清理所有缓存、会话和Cookie时,当我继续工作时

//to explain in plain text

<div id="player_information">...here goes content...</div>
<div id="contacts">....here goes content</div>
编辑2:回应@David Hoerster

$("#main").click(function(){
        $("#player_information").fadeIn("slow");
        $("#contacts").css({"display":"none"});
    });
    $("#contact").click(function(){
        $("#contacts").fadeIn("slow");
        $("#player_information").css({"display":"none"});
    });
<div id="nav_bar">
            <ul>
                <li><div style="display: inline" id="main">Main</div></li>
                <li><div style="display: inline" id="contact">Contact</div></li>
                <li><a href='general/logout.php'>Logout</a></li>
            </ul>
        </div>

  • 主要
  • 接触

我认为这不是来自CSS,您的HTML可能无效

例如,如果您使用HTML编写此文件

<p>
  Content goes here
  <ul>
    <li>Lorem</li>
  </ul>
  Content here too
</p>

内容在这里
  • 洛勒姆
这里也有内容

您的浏览器将以这种方式渲染它

<p>
  Content goes here
</p>
<ul>
  <li>Lorem</li>
</ul>
Content here too
<p></p>

内容在这里

  • 洛勒姆
这里也有内容


试着这样看。

你有没有涉及到javascript/jquery?如果是这样的话,那是什么样子的?听起来像是缺少了一个结束div对我来说
#main
在JavaScript中指的是什么?在您提供的屏幕截图中,我没有看到id为
main
的元素。但为什么它在第一次呈现时应该呈现,而在第二次呈现时不呈现?可能是因为您登录时和未登录时的html结构不同。。。如果我是你,我肯定会这样看。
<p>
  Content goes here
</p>
<ul>
  <li>Lorem</li>
</ul>
Content here too
<p></p>