The operation of the IFRAME in jquery (click the button to add the window) _jquery

Source: Internet
Author: User

<iframe> should also be a form of a framework, unlike <frame>, where an IFRAME can be embedded in any part of a Web page.

Today encountered a problem: How to achieve a click on a button, the current page to add a new small window, display a picture information?

As shown in the following illustration:

Before clicking:

After clicking:

Analysis: To make the new small window does not affect the parent page, we use the technology of the IFRAME framework here.

<iframe> should also be a form of a framework, unlike <frame>, where an IFRAME can be embedded in any part of a Web page. 】

Implementation is the idea: (1) on the button to add a click of the event, after a click to add an iframe window, and will generate pictures of the address added to it.

Specific code to implement:

(1) Add the Click event to the button:

<input type= "Radio" name= "DynamicType" id= "Dianji" style= "padding:0" 10px 0 5px;margin-left:10px;margin-top:13px; " />
<p class= "Loadphoto" ></p>
$ ("#dianji"). Click (function () {
$ ("P.loadphoto"). Empty () ; Empty the contents of the original P label
$ ("P.loadphoto"). HTML ("<iframe width=520 height=400 name=\" touzizuhe\ "id=\" frameborder=0 src= "Generate the address of the picture" ></iframe>);//Add the jquery statement of the IFRAME
});

Note: here the development of the IFRAME, will automatically access to generate the image of the address, so that the production of the picture needs to meet.

About the operation of the IFRAME in jquery (click the button to add a window) to introduce so many people, I hope to help you!

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.