Today i will show you how to use single Bootstrap modal in whole application I have created this demo from where you can fetch data from another file or from some id or class in same page
!function(a){a.fn.customBootstrapModal=function(b){function d(){a("#customModal").on("hidden.bs.modal",function() {a(this).remove()})}var c,d,e={ModalTitle:"Title",dataId:"undefined",CloseText:"Close",modalFooterAlign:"text- right",size:"modal-lg",button:{label:"Ok",show:!0},button2:{label:"Cancel",show:!0},button3: {label:"Save",show:!0}},c=a.extend({},e,b);console.log(e);var f=function(){var b,d;b='<div class="modal fade" data- backdrop="static" id="customModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"><div class="modal-dialog '+c.size+'" role="document"><div class="modal-content"><div class="modal-header"><button type="button" id="closeModel" class="close" data-dismiss="modal" aria-label="Close">'+e.CloseText+'</button><h4 class="modal-title" id="customModalLabel">'+c.ModalTitle+'</h4> </div><div class="modal-body"></div><div class="modal-footer '+c.modalFooterAlign+'"><button type="button" class="btn btn-primary" data-dismiss="modal">'+c.button.label+'</button><button type="button" class="btn btn- primary" data-dismiss="modal">'+c.button2.label+'</button><button type="button" class="btn btn-primary" data- dismiss="modal">'+c.button3.label+"</button></div></div></div> </div>",d=a("body"),d.prepend(b)};this.on("click",function(c){if(f(),a("#customModal").modal("show").find(".modal- body").load(a(this).attr("href"),function(b,c,d){if("error"==c){a("#customModal").find(".modal-body").html("Sorry but there was an error: "+d.status+" "+d.statusText)}}),"undefined"==e.dataId&&a("#customModal").find(".modal- body").html("Please select the id or class it mush be unique.ERROR"),"undefined"!=b.dataId){var d=a("#"+b.dataId).html();a("#customModal").find(".modal-body").html(d)}0==b.button.show&&a("div.modal-foo ter button:first-child").css("display","none"),0==b.button2.show&&a("div.modal-footer button:first- child").next().css("display","none"),0==b.button3.show&&a("div.modal-footer button:last- child").css("display","none"),a("#customModal").modal("show")}),a("body").on("click","#customModal button",function(){d()})}}(jQuery);
This is the HTML structure <!doctype html> <html lang=en> <head> <meta charset=utf-8> <title>jQuery.extend demo</title> <link rel=stylesheet type=text/css href=http://getbootstrap.com/dist/css/bootstrap.min.css> <script src=https://code.jquery.com/jquery-1.10.2.js></script> <style type=text/css> .text-center{text-align:center!important} .text-left{text-align:left!important} .modal{text-align:center;padding:0!important} .modal:before{content:'';display:inline-block;height:100%;vertical-align:middle;margin-right:-4px} .modal-dialog{display:inline-block;text-align:left;vertical-align:middle} </style> </head> <body> <div id=testdata style=display:none>There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc. </div> <button type=button class="btn btn-primary test">Click for modal 1</button> <button type=button href=remote.html class="btn btn-primary test1">Click for modal 2</button> <script type=text/javascript src=http://getbootstrap.com/dist/js/bootstrap.min.js></script> <script type=text/javascript src=modal.js></script> </body> </html>
You can Change the modal size,Heading, Close button text,Button maximum 3,Button alignment;
<script>$(".test").customBootstrapModal({ ModalTitle:"Large Modal Heading", dataId:"testdata", CloseText:"Close", size:"modal-lg", modalFooterAlign:"text-left", button:{ label:"Save",show:true}, button2:{label:"Cancel",show:true}, button3:{label:"Add",show:true} }); $(".test1").customBootstrapModal({ ModalTitle:"Medium Modal Heading", CloseText:"X", size:"modal-md", button:{label:"Save2",show:false}, button2:{label:"Cancel2",show:false}, button3:{label:"Add2",show:true}}); </script>
yamygash b9c45beda1 https://coub.com/stories/2633694-isbd-punctuation-cheat-sheet
fearbard b9c45beda1 https://coub.com/stories/2619128-hot-download-file-pizza_box_mockup_half_side_view_2428654-graphicex-com-zip-190-94-mb-in-free
westhall 8bfa699c61 https://wakelet.com/wake/dBldp1OfN4wAo4ySrzYlc
keaors 79a0ff67a5 https://coub.com/stories/2830032-2021-vtsp-exam-answers
welvas 79a0ff67a5 https://coub.com/stories/2632322-sociology-books-for-ias-pdf-free-sabrcla
newtwar 7383628160 https://trello.com/c/LhJ4m4Zu/25-autodata-2009-v324-keygenrarl-kaylqui
hareelf 7383628160 https://coub.com/stories/3069384-netobjects-fusion-essentials-serial-number-free-crack
giorgabr 7383628160 https://coub.com/stories/2995086-fitnessblender-8-week-fat-loss-program-pdf-free-35-link
imoggio fe98829e30 https://www.cloudschool.org/activities/ahFzfmNsb3Vkc2Nob29sLWFwcHI5CxIEVXNlchiAgIC__oLJCgwLEgZDb3Vyc2UYgIDAgOKckgkMCxIIQWN0aXZpdHkYgIDAkJqF-AgMogEQNTcyODg4NTg4Mjc0ODkyOA
regmak fe98829e30 https://wakelet.com/wake/ooEbsx3B7qmaQTBtkYwBU
jananept fe98829e30 https://trello.com/c/gwYjQhVj/16-toki-arcade-remixed-crack-by-skidrow-top
shayber fe98829e30 https://coub.com/stories/3009313-nunarcdll-16-link
daildave fe98829e30 https://wakelet.com/wake/3a50ud8AILJ1tMHCqqJ8L
glamal fe98829e30 https://www.cloudschool.org/activities/ahFzfmNsb3Vkc2Nob29sLWFwcHI5CxIEVXNlchiAgMCQsbm0CQwLEgZDb3Vyc2UYgIDAkJikjQsMCxIIQWN0aXZpdHkYgIDA4J73oQgMogEQNTcyODg4NTg4Mjc0ODkyOA
faxacaec fe98829e30 https://www.cloudschool.org/activities/ahFzfmNsb3Vkc2Nob29sLWFwcHI5CxIEVXNlchiAgID_htSLCQwLEgZDb3Vyc2UYgICA_4SEpQkMCxIIQWN0aXZpdHkYgIDA0K3tpQkMogEQNTcyODg4NTg4Mjc0ODkyOA
chatru d868ddde6e https://coub.com/stories/3077875-plx-pci6140-aa33pc-dvr-driver-exclusive
maharay d868ddde6e https://coub.com/stories/2985636-leawo-prof-media-8-2-0-0-portable-latest
olwityll d868ddde6e https://coub.com/stories/2955742-__exclusive__-vmware-workstation-10-0-2-build-1744117-keymaker-zwt-free-download
ellslau d868ddde6e https://coub.com/stories/3000893-construction-simulator-gold-edition-incl-dlc-repack-hack-torrent
caelyarm d868ddde6e https://coub.com/stories/3028715-planningandpositioninginmripdf-verified-download
remdwig d868ddde6e https://coub.com/stories/2962345-fifa-13-rld-dll-failed-to-initialize-e1103-14-_hot_
whittak d868ddde6e https://coub.com/stories/2967790-birbal-stories-in-malayalam-pdf-download-top
heyddaev d868ddde6e https://coub.com/stories/3030631-top-rab-ne-bana-di-jodi-3gp-free-download
janoxle d868ddde6e https://coub.com/stories/3070203-indusoft-web-studio-v7-0-crackrar-fynpan
fabidam d868ddde6e https://coub.com/stories/3082355-hd-online-player-komaram-puli-movie-download-utorrent-salulr
orvipar d868ddde6e https://coub.com/stories/3073844-color-efex-pro-30-for-capture-nx-2-keygen-work
rafaemm d868ddde6e https://coub.com/stories/3136916-spotmau-powersuite-golden-2012-keygen-109-yehojae
gavgrai d868ddde6e https://coub.com/stories/3055137-simplify3d-4-1-1-windows-x64-extra-quality
taymeli d868ddde6e https://coub.com/stories/3057788-updated-hack7-v5-1-el-mejor-activador-windows-7-32-y-64-bits-mf
gilthro d868ddde6e https://coub.com/stories/3053234-crack-sprutcam-upd
hilkas d868ddde6e https://coub.com/stories/3103575-__top__-knight-rider-2008-full-movie-free-downloadk
tibecock b7f02f1a74 https://ocidntababdespo.wixsite.com/ficorjaublin/post/kop-kopmeyer-1000-success-principles-pdf-19
nirkame b7f02f1a74 https://inarobahenollaiwa.wixsite.com/forlessgelro/post/crack-gamejack-6-w-serial-by-foc
elfrela c0c125f966 https://sandmoraserti.wixsite.com/thettomecou/post/izo-pe-nectar-license-zip-utorrent-latest-patch-x32-osx
alitwes fb158acf10 https://izexatromo.wixsite.com/atofinah/post/sasha-3-5-years-old-please-tribute-2018-12-07_11-46-50-imgsrc-ru
brimac fb158acf10 https://igorbeqo.wixsite.com/ooptudownre/post/some-of-my-fav-little-boys-4975452xuf-imgsrc-ru
jankurs f4bc01c98b https://coub.com/stories/3271975-top-murder-hd-1080p-hindi
brarai f4bc01c98b https://coub.com/stories/3462097-windows-7-recovery-disk-download-acer-yudinas
fernjan f4bc01c98b https://coub.com/stories/3215282-work-thefastbowlersbiblepdffreedownload
fiaard f4bc01c98b https://coub.com/stories/3271285-bambai-ka-babu-kannada-full-movie-free-download-mp4-link
hilmokii f4bc01c98b https://coub.com/stories/3458426-tmpgenc-authoring-works-52261-crack-hot
risldar f4bc01c98b https://coub.com/stories/3376597-top-thejermmsr206utilityv178writtenbythejerm
claufay f4bc01c98b https://coub.com/stories/3351617-modern-combat-5-blackout-unlimited