- Default
showmodal({content:"Bootstrap 4 Modal Content Here"});
- Primary
showmodal({flag:"primary",Qclose: true});
- Secondary
showmodal({flag:"secondary",Qclose: true});
- Success
showmodal({flag:"success",Qclose: true});
- Danger
showmodal({flag:"danger",Qclose: true});
- Warning
showmodal({flag:"warning",Qclose: true});
- Info
showmodal({flag:"info",Qclose: true});
- Light
showmodal({flag:"light",Qclose: true});
- Dark
showmodal({flag:"dark",Qclose: true});
- White
showmodal({flag:"white",Qclose: true});
- Custom Title
showmodal({
title: "Warning",
content: "Bootstrap 4 Modal Content Here",
SWidth: 200,
fontSize: 14
});
- Alignment
showmodal({
title: "Warning",
content: "Bootstrap 4 Modal Content Here, Bootstrap 4 Modal Content Here, Bootstrap 4 Modal Content Here",
SWidth: 400,
fontSize: 14,
titleCenter:true,
contentLeft:true
});
- Disable hideClick
showmodal({content:"Bootstrap 4 Modal Content Here",hideClick:"static "});
- Callback after shown
showmodal({
content:"Bootstrap 4 Modal Content Here",
callbackShown:function(){
console.log("Shown");
}
})
- Callback after hidden
showmodal({
content:"Bootstrap 4 Modal Content Here",
callbackHide:function(){
console.log("Hidden");
}
})
- Iframe Modal
showmodal({
isText: false,
title: "iFramw Modal",
src: "https://www.youtube.com/embed/9BuLEu6_nb8",
Bclose: false
});
- With Parameters
let bigParam = {
a: 1,
b: 2,
c: 'param',
d: 1,
e: 2,
f: 'param',
g: 1,
h: 2,
i: 'param'
}
showmodal({
isText: false,
src: "https://www.youtube.com/embed/9BuLEu6_nb8",
data: bigParam,
callbackShown:function(){
let _this = this;
console.log(_this.src);
console.log(_this.translateParamsToJson());
}
})
- Iframe Padding
showmodal({
isText: false,
title: "Iframe Modal",
src: "https://www.youtube.com/embed/9BuLEu6_nb8",
iframePadding: true
});
- With Input Field
showmodal({
isText: false,
title: "Iframe Modal",
src: "https://www.youtube.com/embed/9BuLEu6_nb8",
Bclose: false
});
$(function () {
$(document).off('focusin.bs.modal');
$("#txtXXX").focus();
})
- Confirm Callback
showmodal({
title: "Warning",
content: "Bootstrap 4 Modal Content Here",
callbackB: true,
callbackBF:function(){
//dosomething
console.log("Confirm!");
return true;
}
});
- Confirm Callback (asyn)
showmodal({
title: "Warning",
content: "Bootstrap 4 Modal Content Here",
callbackB: true,
callbackBF:function(){
var _this=this;
$.ajax({
type: "POST",
url: "demo.json? &T=" + Math.random(),
dataType: 'text',
async: false,
success: function (t) {
var data = window.eval('(' + t + ')');
if (t.length > 0) {
console.log("123");
console.log("123"+data.news);
_this.closeModal();
}
}
});
return false;
}
});
- Justify buttons
showmodal({
title: "Warning",
content: "Bootstrap 4 Modal Content Here",
Qclose: true,
Justify:true,
callbackQ: true,
callbackQF:function(){
//dosomething
console.log("//dosomething");
return true;
}
});
- Cancel Callback
showmodal({
title: "Warning",
content: "Bootstrap 4 Modal Content Here",
Qclose: true,
callbackQ: true,
callbackQF:function(){
//dosomething
console.log("Cancel");
return true;
}
});
- Multiple Instances
showmodal({
title: "Info",
content: "Are You Sure?",
modalIndex: "01",
Qclose: true,
callbackB: true,
callbackBF: function() {
showmodal({
title: "Info",
modalIndex: "02",
content: "Are You Sure2",
Qclose: true,
SWidth: "300",
hideClick: "static",
fontSize: "18",
callbackB: true,
callbackBF: function() {
showmodal({
title: "Info",
modalIndex: "03",
content: "Are You Sure3",
Qclose: true,
SWidth: "200",
hideClick: "static",
fontSize: "18"
});
return false;
}
});
return false;
}
});
- Fullscreen
showmodal({
title: "Warning",
content: "Bootstrap 4 Modal Content Here, Bootstrap 4 Modal Content Here, Bootstrap 4 Modal Content Here",
isZoom: true,
zoomCallback: function (){
console.log(this.Sheight,this.SWidth);
}
});