jq 修改swal的标题_js-jquery-SweetAlert【一】使用
一、下载安装
地址:http://t4t5.github.io/sweetalert/
二、页面引用
当然还有jquery
三、示例
3.1、基础结构
swal("Here's a message!");//以下代码主要修改这里
}
3.2、精简用法
1、标题【alert】-swal(string)
swal("Here's a message!")
2、标题和描述【alert】-swal(string,string)
swal("Title","des")
3.标题、描述、成功【alert】-swal(string,string,string)
swal("Good job!", "You clicked the button!", "success")
3.2、标准用法
4、确认框【confirm】-swal(object)
swal({
title:"Are you sure?",
text:"You will not be able to recover this imaginary file!",
type:"warning",
showCancelButton:true,
closeOnConfirm:false});
其他参数见下表备注
5、确认框【confirm】-swal(object,function())
swal({
title:"Are you sure?",
text:"You will not be able to recover this imaginary file!",
type:"warning",
showCancelButton:true,
confirmButtonColor:"#DD6B55",
confirmButtonText:"Yes, delete it!",
closeOnConfirm:false},function(){
swal("Deleted!", "Your imaginary file has been deleted.", "success");
});
6、确认框【confirm】-swal(object,function(parameter))
参数含义:是否确认isConfirm
swal({
title:"Are you sure?",
text:"You will not be able to recover this imaginary file!",
type:"warning",
showCancelButton:true,
confirmButtonColor:"#DD6B55",
confirmButtonText:"Yes, delete it!",
cancelButtonText:"No, cancel plx!",
closeOnConfirm:false,
closeOnCancel:false},function(isConfirm){if(isConfirm) {
swal("Deleted!", "Your imaginary file has been deleted.", "success");
}else{
swal("Cancelled", "Your imaginary file is safe :)", "error");
}
});
3.4、确认输出框
7、确认输出框确认框【confirm】-swal(object,function(parameter))
注意:type:input
swal({
title:"An input!",
text:"Write something interesting:",
type:"input",
showCancelButton:true,
closeOnConfirm:false,
animation:"slide-from-top",
inputPlaceholder:"Write something"},function(inputValue) {if (inputValue === false) return false;if (inputValue === "") {
swal.showInputError("You need to write something!");return false}
swal("Nice!", "You wrote: " + inputValue, "success");
});
3.5、ajax
8、ajax请求
swal({
title:"Ajax request example",
text:"Submit to run ajax request",
type:"info",
showCancelButton:true,
closeOnConfirm:false,
showLoaderOnConfirm:true,
},function() {
setTimeout(function() {
swal("Ajax request finished!");
},2000);
});
jq 修改swal的标题_js-jquery-SweetAlert【一】使用相关推荐
- jq 修改swal的标题_js-jquery-SweetAlert2【一】使用
一.下载安装 地址:https://github.com/limonte/sweetalert2 二.页面引用 当然还有jquery 三.示例 3.1.基础结构 window.οnlοad=funct ...
- jq 修改swal的标题_JQuery swal确认没有提交
我尝试使用sweet alert创建确认.当用户单击按钮时,会打开swal(警报)窗口,他们可以确认或取消.如果点击confirm,则JQuery应点击该内容. 但它没有做任何事情.你知道问题出在哪里 ...
- jq修改iframe html代码,使用jQuery替换iframe的所有内容(包括doctype和html标签)
在stackoverflow上还有很多其他帖子提出几乎相同的问题,但在迄今为止我读到的所有答案中,他们没有解决如何实质上替换iframe的整个文档,包括DOCTYPE和html标签.使用jQuery替 ...
- 修改input的text 通过jquery的html获取值 未变化
修改input的text 通过jquery的html获取值 未变化 扩展一个方法 ,通过formhtml()来取代html() (function ($) {var oldHTML = $.fn.ht ...
- jq 修改元素css伪类样式
css伪元素是什么: CSS 伪元素用于向某些选择器设置特殊效果. 伪元素有哪些: :first-line 伪元素:"first-line" 伪元素用于向文本的首行设置特殊样式.: ...
- cadence 批量一次性修改title 页码标题等
1, 在Cadence中,选中dsn,菜单选择edit->browse->titleblock 弹出此框时,一般选择 Use instances 2,弹出的titleblock窗口中,鼠标 ...
- DiscuzX社区怎么修改论坛首页标题和后缀名教程
DiscuzX社区怎么修改论坛首页标题? 登录Discuz站长后台 选择全局菜单栏 点击SEO设置 找到论坛菜单(如下图) 将title标题修改为自己的名称即可 怎么修改.删除站点名称-后缀名? 登录 ...
- discuz 标题字数限制问题修改·最简单明了之方法---快速修改discuz发帖标题限制问题
discuz 标题字数限制问题修改·最简单明了之方法---快速修改discuz发帖标题限制问题 网上有很多百度经验之类发布的内容图片太多看起来很头疼,直接简单明了的方法如下纯文字,假如我需要修改为标题 ...
- 苹果cms如何修改分类的标题、关键字、描述等seo参数
修改苹果cms分类页标题.关键字.描述seo优化直接在苹果cms系统后台搞定,具体步骤也很简单. 1,来到系统后>>基础>>分类管理>>编辑 修改苹果cms分类页标 ...
最新文章
- Java如何转换protobuf-net中的bcl.DateTime对象
- 安卓开发8-WebView支持文件上传
- ArcGIS 10.0 ArcGIS 9.3.1数据生成实验--个人地理数据库
- ASP.NET Core MVC 之依赖注入 Controller
- QT 线程池 + TCP 小试(一)线程池的简单实现
- OSI网络模型(TCP/IP五层模型)
- node mysql 模块 封装_node.js基于工厂方法的mysql模块封装
- CodeForces - 1517B Morning Jogging
- 安装TensorFlow-gpu
- 黑鲨官网装机大师工具如何制作u盘启动盘,u盘启动盘制作方法
- windows 文件后缀名
- extjs 调用金税COM接口
- pycharm专业版使用
- 正确使用计算机键盘的方法是,电脑键盘指法练习的方法
- 人人都是产品经理2.0-04章摘要
- 使用HTML写一个简历表格
- oracle修改open_cursors,oracle的open_cursors问题探究
- HTML5标签+基础特性
- 计算机专业文科生录取分数线,文科生适合报考的5所学校,录取分数线不高,但就业前景很好...
- 小学教师资格证考试的高分技巧