|
1,引入js
- <script type="text/javascript" charset="utf-8" src="./plugins/af.popup.js"></script>
复制代码
2.写对应的方法
- <script>
- function showPopup1() {
- $("#afui").popup("I'm replacing an alert box");
- }
- function showPopup2() {
- $("#afui").popup({
- title: "Alert! Alert!",
- message: "This is a test of the emergency alert system!! Don't PANIC!",
- cancelText: "Cancel me",
- cancelCallback: function () {
- console.log("cancelled");
- },
- doneText: "I'm done!",
- doneCallback: function () {
- console.log("Done for!");
- },
- cancelOnly: false
- });
- }
- function showPopup3() {
- $("#afui").popup({
- title: "Login",
- message: "Username: <input type='text' class='af-ui-forms'><br>Password: <input type='text' class='af-ui-forms' style='webkit-text-security:disc'>",
- cancelText: "Cancel",
- cancelCallback: function () {},
- doneText: "Login",
- doneCallback: function () {
- alert("Logging in")
- },
- cancelOnly: false
- });
- }
- </script>
复制代码
|
|