简体   繁体   English

为什么当我使用模态淡入淡出时,我认为它不起作用?

[英]why when i use modal fade as i suppose to it did not work?

I've been working with modal fade and it didn't work what suppose happen is adding a new grade in partial view so i decided to work with modal fade and i didn't know anything about it.我一直在使用模态淡入淡出并且它没有工作假设发生的是在局部视图中添加一个新等级所以我决定使用模态淡入淡出并且我对此一无所知。

so there is the code and please help me to fix the problem所以有代码,请帮我解决问题

<p>@* Button *@
   <a href="#" class="btn btn-primary" onclick="AddEdit(0)">New Grades</a>
</p>

<div class="modal fade" id="mymodal1">
    <div class="modal-dialog">
        <div class="modal-content">
                <div class="modal-header">
                    <a href="#" class="close" data-dismiss="modal">&times;</a>
                    <h3 class="modal-title">Add/Edit Grades</h3>
                </div>
            <div class="modal-body" id="myModalBodyDiv1">

                <div style="text-align:center;display:none" id="loaderDiv">
                    <img src="~/Image/load2.gif" width="150" />
                </div>
            </div>
            <div class="modal-footer">
                    
            </div>
        </div>
    </div>

</div>

<script>
    var AddEdit = function (id) {
        var url = "/Grades/AddEditGrade/" + id;
        $("#myModalBodyDiv1").load(url, function () {
            $("mymodal1").modal("show");
        })
    }

</script>

any idea how can i fix it ??知道我该如何解决吗?

you are missing ID selector symbol in this line:您在此行中缺少 ID 选择器符号:

wrong: $("mymodal1").modal("show");
modified: $("#mymodal1").modal("show");

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么有时JavaScript无法正常工作? (我使用过Ci) - Why sometimes javascript did'nt work? (i've use Ci) 我有9个小图像,当单击它们时,它们会在图像的较大版本中消失。 为什么不能在Browser(FF)中工作) - I have 9 small images that when clicked on, will fade in the bigger version of the image. Why wont work in Browser(FF)) 为什么在未安装相关组件时保持“模态背景淡入淡出显示”存在,我应该如何“删除/禁用”这个 div - Why keeps the "modal-backdrop fade show" exist when the concerning component is un-mounted and how should i "remove/disable" this div 为什么我的日期选择器在bootstrap modal中固定。我在尝试添加几个jquery解决方案以解决问题时陷入困境,但对我不起作用 - Why my date picker get fixed in bootstrap modal.I got stuck trying to add several jquery solutions to resolved but did not work for me 为什么即使我在初始化云函数目录时选择了 TypeScript,Firebase CLI 也会问我是否要使用 ESLint? - Why did Firebase CLI asked me if I wanted to use ESLint even when I selected TypeScript while initialising a cloud functions directory? 使用接头时为什么我的功能不能正常工作? - Why won't my function work when I use splice? 当我使用“==”时,为什么datepicker突出显示不起作用? - Why does datepicker highlight not work when I use “==”? 使用锚点时,为什么按键处理程序不起作用 - Why does my keypress handler not work when I use anchors 当我使用“和”或“或”时,为什么我的替换在javascript中正常工作,但在我使用“&”或“/”或“+”时却没有 - Why does my replace work properly in javascript when I use “and” or “or” but not when I use “&” or “/” or “+” 使用jQuery UI的Modal形式时,为什么不能将所选文件发布到服务器客户端? - Why can't the selected files be posted to server client when I use Modal form of jQuery UI?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM