Jquery mode pop-up window)

Source: Internet
Author: User
Code

< Html >
< Head >
< Meta HTTP-equiv = "Content-Type" Content = "Text/html; charset = gb2312" >
< Title > Popup </ Title >
< Script Type = "Text/JavaScript" SRC = "JS/Popup. js" > </ Script >
< Script Type = "Text/JavaScript" SRC = "JS/popupclass. js" > </ Script >
</ Head >
< Body >
< P Align = "Center" >
< Input Type = "Button" Value = "Open Baidu" Onclick = "Showiframe ('Baidu ', 'HTTP: // www.baidu.com', 800,450 )" > < BR >
< Input Type = "Button" Value = "HTML string" Onclick = "Showhtmlstring ('string', '<B> hello, popwin', 400,200 )" > < BR >
< Input Type = "Button" Value = "Information prompt box" Onclick = "Showalert ('prompt box ',' <B> hello, popwin', 200,100 )" > < BR >
< Input Type = "Button" Value = "Confirm" Onclick = "Showconfirm ('confirmed', 'delete', 'button4','', 80 )" >
</ P >
</ Body >
</ Html >  

 

The call is relatively simple. The scripts are Popup. js and popupclass. js. Popupclass is the original Js of Baidu Network (in fact, it is not exactly the same, because I think it is difficult to see the close icon in the pop-up window, so I changed it ~~~~) Popup. JS is a call method that I extract based on its JS file. Now I will introduce Popup. js. For more information about popupclass. JS, see the article on Baidu space in taohua xiaoshe.ArticleBaidu space popup effect analysis. Basically, I simply encapsulated it according to his ideas.

Showiframe (title, contenturl, width, height)

    • Title in the pop-up window
    • Page path of the contenturl pop-up window
    • Width
    • Height the height of the pop-up window

Showhtmlstring (title, strhtml, width, height)

    • Title in the pop-up window
    • Strhtml htmlCode
    • Width
    • Height the height of the pop-up window

Showalert (title, alertcon, width, height)

    • Title
    • Content of the alertcon pop-up dialog box
    • Width
    • Height dialog box height

Showconfirm (title, confirmcon, ID, STR, width, height)

    • Title pop-up confirmation box title
    • Confirm pop-up confirmation box content
    • ID: the ID of the control to trigger the event after you click OK.
    • STR value (retained)
    • Width
    • Height pop-up to confirm the height of the mine

Then, how can we close the pop-up window? Of course, click the X in the upper right corner. If you use code, you only need to call a function parent. closepop.

If the pop-up window of the Framework is displayed on the parent page, you only need to add a parent before the function. For example, parent. showiframe ('Baidu ', 'HTTP: // www.baidu.com', 500,200 ).

 

/Files/njnudt/popup.rar

 

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.