JS mobile phone end floating layer control, and a variety of pop-up tips, compatible with PC-side browser

Source: Internet
Author: User

JS dialog components, including the implementation of alert and confirm

All resources for this component can be viewed on GitHub with source code GitHub

For an example of this dialog component, please check the demo here

Dialog

JS dialog pop-up window

Usage this is the content

<input type= "button" id= "Btn_dialog" value= "open floating layer"/><div id= "dialog-content" style= "Display:none;" > This is content </div><script src= ". /src/jquery-1.9.1.min.js "></script><script src=". /src/dialog.js "></script><script>    varNew  Dialog ();    Dialog.init ({target:"#dialog-content", Trigger: "#btn_dialog", Mask:true, Width:500,height:300,title : ' title '}); </script>

or call it in jquery:
   <input type= "button" id= "Btn_dialogjquery" value= "JQ open floating layer"/><div id= "DIALOG-CONTENTJQ" style= "Display:none;" > This is content 22</div><script src= ". /src/dialog-jquery.js "></script><script>    $ (' #btn_dialogjquery '). Dialog ({target: "#dialog-contentjq", Mask:true, Width:500,height:300,title: ' title '})</script >    

Inheriting class alert and confirm hints (in jquery mode):
*HTML:<input type= "button" id= "Btn_alert" value= "alert"/> <input type= "button" id= "Btn_alert2" value= "Alert timed off"/&    Gt <input type= "button" id= "Btn_confirm" value= "confirm three kinds of buttons"/> <input type= "button" id= "Btn_confirmdefault" Value= "Confirm Default"/> *JS: $ (' #btn_alert '). Click (function() {$.alert (' Choose a product to upload material oh ',true,function() {alert (' You clicked OK ')        })    }); $(' #btn_alert2 '). Click (function() {$.alert (' Choose a product to upload the material. ')    }); $(' #btn_confirm '). Click (function() {$.confirm (' Download all 9 photos to a local album? <div class= "Confirm-title2" > Text content copied </div> ', [{yes: ' yes '},{no: ' No '},{close: ' Off '}],function(type) {$.alert (' You clicked on ' +type);  This. Hide ();    }); })    $(' #btn_confirmdefault '). Click (function() {$.confirm (' Are you sure you want to delete this message? ‘,NULL,function(type) {$.alert (' You clicked on ' +type);  This. Hide ();    }); })

Property or Method Property trigger:
    触发对象
Target
    弹出内容,可以为#id,或者jquery对象
Mask
    是否有遮罩层
Title
    标题
ZIndex:
    z-index
CLOSETPL:
    关闭html(默认:<span class="ui-dialog-close js-dialog-close">x</span>)
TITLETPL:
    
Method and Callback show:
    显示弹层
Hide
    隐藏
Beforeshow:function (content)
    显示前的方法回调,content是浮层内容对象
Beforehide:function (content)
    隐藏前的方法回调,content是浮层内容对象
Setposition:function ()
    设置位置居中

JS mobile phone end floating layer control, and a variety of pop-up tips, compatible with PC-side browser

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.