Html中模态框(弹出框)使用入门
作为html学习学习模态框需要二步:
效果图
第一步学习HTML中 div的弹出
②HTML代码
#typeView,#musicView{ display:none; border:1em solid #3366ff; height:auto; width:%; left:%; top:%; position:absolute; <!-- --> z-index:; <!-- 层级优先级--> background:white; } <div id="typeView"> <label class="quit glyphicon glyphicon-off ">取消</label> <form id="f_type" method="post" enctype="multipart/form-data"> <div class="form-group"> <label>类型名字</label> <input type="text" name="T_Name" id="T_Name" class="form-control" /> <input type="/> </div> <div class="form-group"> <label>备注</label> <textarea name="T_Remark" id="edit" class="form-control"></textarea> </div> <div class="form-group"> <input type="button" class="form-control btn btn-success" id="bt_addType" value="增加" /> </div> </form> </div>
③触发JQ事件
$("#addType").click(function () { var edit = new wangEditor('edit').create(); $("#typeView").show(); })
第二步学习BOOTStrap3中的模态框
效果图:
1.创建模态框
<div class="modal fade" id="adminView" role="dialog" aria-labelledby="myModalLabel"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> <h4 class="modal-title" id="myModalLabel">用户管理</h4> </div> <div class="modal-body"> <form action="/api/admin/" class="" method="post" id="Form_AdminView" type=""> <input type="hidden" id="Adm_Id" name="Adm_Id" /> <div class="form-group"> <label>名字</label> <input type="text" class="form-control" name="Adm_Name" id="Adm_Name" /> </div> <div class="form-group"> <label>账号</label> <input type="text" name="Adm_Card" class="form-control" id="Adm_Card" /> </div> <div class="form-group"> <label>密码</label> <input type="text" name="Adm_Pwd" class="form-control" id="Adm_Pwd" /> </div> </form> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">取消</button> <button type="button" class="btn btn-primary" id="Btn_AdminView">修改</button> </div> </div> </div> </div>
2.调用使用模态框
$("#btn_AddAdmin").click(function () { //操作类型 $("#Form_AdminView").attr("type", "add"); //重置输入框内的值 $("#Form_AdminView").find("input").val(""); //显示模态框 $("#adminView").modal("show"); }); <!-- 隐藏 $("#adminView").modal("hide") -- >
试用版模态框的时候出现的问题:
1.模态框用来编辑或增加,如果add/edit用同一个个模态框,就会存在上一次的值保留的问题 b
解决:$("form > input").val("") =》form表单清空
2016.5.12
问题2:用B3模态框存在编辑器变性,看怎么解决
Html中模态框(弹出框)使用入门的更多相关文章
- bootstrap中popover.js(弹出框)使用总结+案例
bootstrap中popover.js(弹出框)使用总结+案例 *转载请注明出处: 作者:willingtolove: http://www.cnblogs.com/willingtolove/p/ ...
- 在IOS11中position:fixed弹出框中的input出现光标错位的问题
问题出现的背景: 在IOS11中position:fixed弹出框中的input出现光标错位的问题 解决方案 一.设计交互方面最好不要让弹窗中出现input输入框: 二.前端处理此兼容性的方案思路: ...
- firefox浏览器中 bootstrap 静态弹出框中select下拉框不能弹出(解决方案)
问题出现场景1: 在firefox浏览器中在bootstrap弹出的modal静态框中再次弹出一个静态框时 select下拉框不能弹出选项 解决方案:去掉最外层静态框的 tabindex=" ...
- js中三种弹出框
javascript的三种对话框是通过调用window对象的三个方法alert(),confirm()和prompt()来获得,可以利用这些对话框来完成js的输入和输出,实现与用户能进行交互的js代码 ...
- 蜗牛爱课 - iOS7、8模态半透明弹出框
//源Controller中跳转方法实现 MKDialogController *controller = [[MKDialogController alloc] init]; controller. ...
- IOS中position:fixed弹出框中的input出现光标错位的问题
解决方案是 在弹框出现的时候给body添加fixed <style type="text/css"> body{ position: fixed; width: 100 ...
- WebDriver测试web中遇到的弹出框或不确定的页面
我自己是用try catch解决的,不知道其他人的解决方法?如有,可以留言
- updatepanel中使用alert弹出框方法
原文发布时间为:2009-05-17 -- 来源于本人的百度文章 [由搬家工具导入] ScriptManager.RegisterStartupScript(this.UpdatePa ...
- js中的alert弹出框文字乱码解决方案
使用如下代码即可: echo '<html>'; echo '<head><meta http-equiv="Content-Type" conten ...
- ⒁bootstrap组件 工具提示框 弹出框 警告框 基础案例
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
随机推荐
- SharePoint 2013 showModalDialog 弹出模式窗口
1. SharePoint 弹出框 本文讲述SharePoint 2013 中使用 SP.UI.ModalDialog.showModalDialog时 showModalDialog 未定义的问题 ...
- [转]MOSS通过此命令注册模板,web应用程序可以根据stp模块生成网站集
注:C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\bin stsadm –o add ...
- android tools使用方式
我们希望在布局中显示测试的属性,而这个属性不会影响到正式代码,因此我们就需要tools这个命名空间. 首先定义:xmlns:tools="http://schemas.android.com ...
- Android使用Fragment来实现ViewPager的功能(解决切换Fragment状态不保存)以及各个Fragment之间的通信
以下内容为原创,转载请注明:http://www.cnblogs.com/tiantianbyconan/p/3364728.html 我前两天写过一篇博客<Android使用Fragment来 ...
- yii redies 不同的工程缓存key的问题
参考这篇文章 基本配置操作: yii main.php中: return array( ... 'components'=>array( 'redis_cache' => array ( ...
- linux 系统权限 数字含义
摘抄: sudo chmod XXX dir_name XXX是你要设置的权限代号,第一位代表Owner,第二位代表Group,第三位代表Others XXX中0代表什么都不可以,1代表可执行,2代表 ...
- 【代码笔记】iOS-看图听声音
一,效果图. 二,工程图. 三,代码. RootViewController.h #import <UIKit/UIKit.h> #import <AVFoundation/AVFo ...
- 【原】Mac下统计任意文件夹中代码行数的工具——cloc
这里介绍一个Mac系统统计代码行数的工具cloc. 1.首先,安装homebrew,已安装的请跳过. 打开终端工具Terminal,输入下列命令.过程中会让你按RETURN键以及输入mac桌面密码,按 ...
- JQuery制作简单的网页导航特效
使用JQuery中hover()方法,使其根据鼠标的移动简单的改变背景颜色; hover();用于模拟鼠标指针悬停事件,当鼠标指针移动到元素上时,会触发指定的第一个函数,当鼠标指针移除这个元素时,会触 ...
- android开发练习:天气应用
来源:网易云课堂GeekBand第七次作业 作业要求: 做一个天气应用 接口参考: http://apistore.baidu.com/apiworks/servicedetail/880.html, ...