Skip to content

boot4modal.js Easy & Light weight Javascripts lib allow you to create alert or confirm modal based on Bootstrap 4.3.1 modals

License

Notifications You must be signed in to change notification settings

MkLHX/boot4modal

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

boot4modal

boot4modal.js Easy & Light weight Javascripts lib allow you to create alert or confirm popups based on Bootstrap 4.3.1 modals

Getting Started

Dependencies

  • Bootrap version 4.3.1
  • Jquery version 3.3.1
  • Popper.js version 1.14.7

official CDNs

Example

  • Alert message
<script>
  boot4.alert(
      {
          title: 'boot4modal alert popup',
          msg: 'This is a simple alert popup',
          centered: true
      }
  );
</script>
  • Alert message with callback function
<script>
  boot4.alert(
      {
          title: 'boot4modal alert with callback',
          msg: 'This alert have a callback to listen button click',
          buttons_labels: {
              ok_btn: 'Understand',
          },
          centered: true,
          callback: function () {
              alert('you\'re in callback method');
          }
      }
  );
</script>
  • Confirm message
<script>
  boot4.confirm(
      {
          title: 'boot4modal confirm popup',
          msg: 'This is a confirm popup, callback is run on each buttons',
          buttons_labels: {
              cancel_btn: 'Cancel',
              ok_btn: 'Ok'
          },
          centered: true,
          callback: function (result) {
              if (result) {
                  alert("ok clicked");
              }
              else {
                  alert("cancel clicked");
              }
          }
      }
  );
</script>

installation

just add this in your template

<script type="text/javascript" src="https://cdn.jsdelivr.net/gh/MkLHX/[email protected]/boot4modal.js"></script>;

enjoy

Enjoy and use it!

credits

MkLHX

based on @fixxyzeal project

About

boot4modal.js Easy & Light weight Javascripts lib allow you to create alert or confirm modal based on Bootstrap 4.3.1 modals

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%