JS compatible PC-side browser with a variety of pop-up tips for mobile phone-side floating-layer control instances

Source: Internet
Author: User

This article mainly introduces the JS-compatible PC-side browser and has a variety of pop-up tips of the mobile phone-side floating-layer control, example analysis of JavaScript a variety of pop-up effect of the implementation techniques, very practical value, the need for friends can refer to the

Full instance code click here to download the site.



1 2 3 4 5 6 7 8 <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> var Dialog = New dialog (); Dialog.init ({target: "#dialog-content", Trigger: "#btn_dialog", Mask:true,width:500,height:300,title: ' title '}); </script>

or call it in jquery:


1 2 3 4 5 6 <input type= "button" id= "Btn_dialogjquery" value= "JQ open the Floating layer"/> <div id= "dialog-contentjq" style= "Display:none"; > This is the 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):



1 2 3 4 <input type= "button" id= "Btn_alert" value= "alert"/> <input type= "button" id= "Btn_alert2" value= "Alert timed off"/ > <input type= "button" id= "Btn_confirm" value= "confirm three kinds of buttons"/> <input type= "button" id= "Btn_confirmdefault "value=" Confirm default/>



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19-20 $ (' #btn_alert '). Click (function () {$.alert (' Select a good product to upload material oh ', true,function () {alert (' You clicked OK ')}}); $ (' #btn_alert2 '). Click (function () {$.alert (' Choose a good product to upload material Oh ')}); $ (' #btn_confirm '). Click (The function () {$.confirm (' Download all 9 pictures to the local album? <div class= ' confirm-title2 ' > Text content replicated </div > ', [{yes: ' is '},{no: ' No '},{close: ' Close '}],function (type) {$.alert (' you clicked ' +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:



Trigger Object


Pop-up content, can be #id, or jquery object


Is there a mask layer






Turn off HTML (default: X)


Title HTML (default:



Method and callback:


Show projectile layer



Beforeshow:function (content)

The method callback before the display, content is the floating Layer contents object

Beforehide:function (content)

Pre-hidden method callback, content is a floating layer contents object

Setposition:function ()

Set Position Center

I hope this article will help you with your JavaScript programming.

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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.