当我单击头部时,我正在尝试制作一个信息框,内容会向下滑动,
但是当我这样做时,它只会向下滑动然后再次向上滑动。
它在 ascx 文档中,我需要在 dotnetnuke 容器上使用它,
它在 html 文件中完美运行
这是代码
<script type="text/javascript">
$(document).ready(function () {
$('.head').click(function () {
$('.content').slideToggle();
});
});
</script>
或者
$(document).ready(function () {
$('.textbox .content:eq(1)').hide();
$('.textbox .head').click(function () {
if ($(this).next('.content').is(':visible')) {
$(this).next('.content').slideUp();
} else {
$(this).next('.content').slideDown();
}
});
});