gpt4 book ai didi

javascript - jQuery .toggle() 模态显示/隐藏对话框

转载 作者:塔克拉玛干 更新时间:2023-11-02 22:19:25 25 4
gpt4 key购买 nike

我浏览了一些类似的问题 - 但我一直在寻找,但没有找到与我想要做的相同的实现。

非常简单:

<a class="contacttoggle" href="#">Contact</a>
<div>Lots of content between</div>
<div>Lots of content between</div>
<div>Lots of content between</div>
<div>Lots of content between</div>
<div class="contact_box">Contact info that is initially hidden and then fades in when the "contact_toggle" Contact link above is clicked</div>

我正在寻找它淡入并且它会绝对定位在页面上(不用担心我可以处理 CSS)。我只是不要想要幻灯片效果。淡入淡出。

我觉得这段代码应该可以工作,但事实并非如此:(

$(document).ready(function(){


/* function to show and hide main navigation conatct box */
$(".contact_box").hide();

$('a.contacttoggle').click(function() {
$(this).next("div").find(".contact_box").toggle(400);
return false;
});


})

最佳答案

fadeToggle呢? ?

关于javascript - jQuery .toggle() 模态显示/隐藏对话框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5333637/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com