Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/77.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 jQuery切换css混乱_Javascript_Jquery_Html_Css - Fatal编程技术网

Javascript jQuery切换css混乱

Javascript jQuery切换css混乱,javascript,jquery,html,css,Javascript,Jquery,Html,Css,我使用jquery切换函数来显示或隐藏一个使用css显示的div,但是当我切换它显示div时它会变得混乱,但是当我想隐藏它时,它也会切断我的顶部栏 以下是JS: $(document).ready(function() { $(".toggle").click(function() { var e = $(this).attr("href"), n = $(this); $(e).toggle(function() { n.html("none"

我使用jquery切换函数来显示或隐藏一个使用css显示的div,但是当我切换它显示div时它会变得混乱,但是当我想隐藏它时,它也会切断我的顶部栏

以下是JS:

$(document).ready(function() {
$(".toggle").click(function() {
    var e = $(this).attr("href"),
        n = $(this);
    $(e).toggle(function() {
        n.html("none" == $(this).css("display") ? "Links" : "Close")
    })
});
这是链接,当你打开并点击链接按钮时,它会显示链接,但我的顶部菜单会被切断

这是扳机

<a href="#collapse1" class="toggle">Links</a>


刚刚搞定,但忘了设置分区的最小高度。

您的网站似乎运行正常。。有什么问题?顶部菜单也可以正常工作,并且不会在单击时被剪切links@Reddy看屏幕截图这是我在我的机器上看到的。。。我用的是铬。可能是您的css与浏览器不兼容。。你能试试看这个链接吗?它也是我的谢谢你的时间@Reddy