English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

jQuery iOS pop-up box plugin

This pop-up box plugin is a custom plugin I wrote myself, imitating the iOS native pop-up box. It includes Alert pop-up box and Confirm confirmation box, supports custom title, content, button text, and button callback function, is very easy to use, can be extended, and the following is the plugin usage method, just look and understand:

Firstly, import the jQuery library, plugin library, and CSS file

<script src="./jquery-1.8.3.min.js"></script>
<script src="./jquery.confirm-1.1.js"></script>
<link href="./jquery.confirm-1.1.css" rel="external nofollow" rel='stylesheet' type='text/css' />

Alert pop-up box quick use

$.alert('Are you sure to continue&63;'); --Content supports HTML code
$.alert({
 title: 'Alert popup box!', --Title Default title (温馨提示)
 content: 'Are you sure to continue? --Content
});

Use of Alert callback popup box

$.alert({
 title: 'Alert callback popup box!',
 content: 'alert with callback function, click the confirm button to trigger the callback function',
 buttons: {
  ok: {
   text: 'Good', --Button title
   action: function () { --Callback event
     alert("Button callback function is executed");
   }
  }
 }
});

Use of Confirm confirmation box

$.confirm('Are you sure to continue?');
$.confirm({
 title: 'Confirm confirmation box!', 
 content: 'Are you sure to continue? 
});

Use of Confirm callback confirmation box

$.alert({
 title: 'Confirm callback confirmation box!',
 content: 'Confirm confirmation box, click the button to trigger the callback function',
 buttons: {
  ok: { --Confirm button
   text: 'Confirm',
   action: function () {
     alert("The confirm button callback function is executed");
   }
  },
  close: { --Close button
   text: 'Close',
   action: function () {
     alert("The close button callback function is executed");
   }
  }
 }
});

The confirmation box button can be placed multiple times

Effect display

Is it very simple to use -_-

Download link:https://pan.baidu.com/s/1pLJJky3

The above-mentioned is the jQuery iOS popup plugin introduced by the editor to everyone, hoping it will be helpful to everyone. If anyone has any questions, please leave a message, and the editor will reply to everyone in time. At the same time, I would also like to express my heartfelt thanks to everyone for their support of the Yelling Tutorial website!

You May Also Like