1、下载并修改插件
可以在官网上下载到最新版(http://plugins.jquery.com/files/boxy-0.1.4.zip),到我写这些文字的时候最新版为0.1.4版,下载解压后有1个主要的js文件:jquery">

Home  >  Article  >  Web Front-end  >  Pop-up layer 1: JQuery.Boxy (1) Introduction to use_jquery

Pop-up layer 1: JQuery.Boxy (1) Introduction to use_jquery

WBOY
WBOYOriginal
2016-05-16 18:01:091098browse


1. Download and modify the plug-in
You can download the latest version from the official website (http://plugins.jquery.com/files/boxy-0.1.4.zip), go to me When writing these words, the latest version is version 0.1.4. After downloading and unzipping, there is 1 main js file: jquery.boxy.js; 1 css file; and 4 pictures used to form the 4 rounded corners of the pop-up layer. . Introduce the file into the system, modify boxy.css, and change the image path below to the actual location in the project. If the setting is incorrect, the image will become invalid and it will be ugly.

Copy code The code is as follows:

/* Modify the image here to be relative to css The path to the image file of the file*/
.boxy-wrapper .top-left { background: url('../images/boxy-nw.png'); }
.boxy-wrapper .top-right { background: url('../images/boxy-ne.png'); }
.boxy-wrapper .bottom-right { background: url('../images/boxy-se.png'); }
.boxy-wrapper .bottom-left { background: url('../images/boxy-sw.png'); }
/* Note: The following path must be in the form of absolute path or url +/ //www.xxx.com/xxx.png appears*/
.boxy-wrapper .top-left { #background: none; #filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/images/ boxy-nw.png'); }
.boxy-wrapper .top-right { #background: none; #filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/images/boxy-ne.png') ; }
.boxy-wrapper .bottom-right { #background: none; #filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/images/boxy-se.png'); }
.boxy -wrapper .bottom-left { #background: none; #filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/images/boxy-sw.png'); }


2. Plug-in referenced to the page






3 , bind the boxy behavior to the matching element



3.1. Click me and a dialog box will pop up




If the title in the a tag is not set, the pop-up box will have no title and cannot be dragged; the anchor mark m1 after the href is the corresponding element id to be popped up; the displayed element defaults if it is set to none The popup will set the display. < ;script type="text/javascript">

$(function() {
$(".boxy").boxy();
});
< ;a href="../default.aspx" class="boxy" title="Prompt">3.2. Load a document and display the prompt message

href hyperlink to the file whose content you want to pop up.

3.3. A confirmation box will pop up when submitting




Copy the code

The code is as follows: