gpt4 book ai didi

javascript - 下面的js代码在asp.net中正确吗

转载 作者:行者123 更新时间:2023-11-28 08:28:50 25 4
gpt4 key购买 nike

Site.js

/* blur on modal open, unblur on close */
$('#aboutsbaims').on('show.bs.modal', function () {
$('#mycontent').addClass('blur');
});

$('#aboutsbaims').on('hide.bs.modal', function () {
$('#mycontent').removeClass('blur');
});

这段代码正确吗?它不起作用。我检查了 div id 名称,它们是正确的。没有拼写错误

这是我的详细问题的链接。请尽快答复 Want to blur the background on twitter-bootstrap modal load. The javascript code is not working

最佳答案

尝试将代码包装在 DOM 就绪处理程序中 $(function() { ... });确保所有 DOM 元素都正确加载,因为您已经包含了 Site.js<head>您页面的部分。

$(function() {
/* blur on modal open, unblur on close */
$('#aboutsbaims').on('show.bs.modal', function () {
$('#mycontent').addClass('blur');
});

$('#aboutsbaims').on('hide.bs.modal', function () {
$('#mycontent').removeClass('blur');
});
});

关于javascript - 下面的js代码在asp.net中正确吗,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22088731/

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