首页前端开发其他前端知识Bootstrap中model隐藏如何实现,方法及操作是什么

Bootstrap中model隐藏如何实现,方法及操作是什么

时间2024-03-27 03:36:03发布访客分类其他前端知识浏览1292
导读:这篇文章主要给大家介绍“Bootstrap中model隐藏如何实现,方法及操作是什么”的相关知识,下文通过实际案例向大家展示操作过程,内容简单清晰,易于学习,有这方面学习需要的朋友可以参考,希望这篇“Bootstrap中model隐藏如何实...
这篇文章主要给大家介绍“Bootstrap中model隐藏如何实现,方法及操作是什么”的相关知识,下文通过实际案例向大家展示操作过程,内容简单清晰,易于学习,有这方面学习需要的朋友可以参考,希望这篇“Bootstrap中model隐藏如何实现,方法及操作是什么”文章能对大家有所帮助。
  

bootstrap model隐藏的方法:首先外引boostrap和Jquery的文件环境;然后添加一个大的div;最后通过设置“aria-hidden”属性隐藏模态框即可。

本教程操作环境:windows7系统、bootstrap3版,该方法适用于所有品牌电脑。

Modal(模态框)

首先,外引boostrap和Jquery的文件环境:

    link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
    
    script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js">
    /script>
    
    script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js">
    /script>
    

一般是按钮或者链接触发modal

button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">
    开始演示模态框/button>
    !-- 模态框(Modal) -->
    

首先添加一个大的div, fade:淡入淡出的效果 aria-hidden是为了隐藏模态框

div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true")

然后在modal-content下,插入modal-header,modal-body,modal-footer

div class="modal-content">
    
            div class="modal-header">
    
                button type="button" class="close" data-dismiss="modal" aria-hidden="true">
    ×/button>
    
                h4 class="modal-title" id="myModalLabel">
    模态框(Modal)标题/h4>
    
            /div>
    
            div class="modal-body">
    在这里添加一些文本/div>
    
            div class="modal-footer">
    
                button type="button" class="btn btn-default" data-dismiss="modal">
    关闭/button>
    
                button type="button" class="btn btn-primary">
    提交更改/button>
    
            /div>
    
        /div>
    !-- /.modal-content -->
    

& times; 就是X的符号,点击关闭或者x或者点“Ese”都可以退出模态框

如果,你想点击提交更改也可以退出模态框,你可以添加一个onclick事件,在script里添加$("#myModal").modal("hide"); 如下

button type="button" class="btn btn-primary" onclick="user_del()" id="user-change">
    提交更改/button>
 function user_del(){
    
    $("#user").modal('hide');

}
    

以上就是退出功能问题,至于弹出的模态框,可以在modal-body里写入一系列的form-group,输入框组,详情进入boostrap的官网查看输入框组的学习即可,代码效果如下:


感谢各位的阅读,以上就是“Bootstrap中model隐藏如何实现,方法及操作是什么”的内容了,通过以上内容的阐述,相信大家对Bootstrap中model隐藏如何实现,方法及操作是什么已经有了进一步的了解,如果想要了解更多相关的内容,欢迎关注网络,网络将为大家推送更多相关知识点的文章。

声明:本文内容由网友自发贡献,本站不承担相应法律责任。对本内容有异议或投诉,请联系2913721942#qq.com核实处理,我们将尽快回复您,谢谢合作!


若转载请注明出处: Bootstrap中model隐藏如何实现,方法及操作是什么
本文地址: https://pptw.com/jishu/653953.html
golang处理输入用什么方法,代码是怎么样 Bootstrap中table的用法是什么,具体怎样应用

游客 回复需填写必要信息