Iframe operation in jQuery (click the button to add a window), jqueryiframe

Source: Internet
Author: User

Iframe operation in jQuery (click the button to add a window), jqueryiframe

<Iframe> is also a form of framework. Unlike <frame>, iframe can be embedded in any part of the webpage.

Today, I encountered a problem: how can I click a button to add a new small window on the current page to display an image?

As shown in:

Before clicking:

After clicking:

Analysis: to make the new small window do not affect the parent page, we use the iframe framework technology here.

[<Iframe> is also a form of framework. Unlike <frame>, iframe can be embedded in any part of the webpage .]

Implementation is the idea: (1) Add a click event on the button, add an iframe window after the click, and add the address of the generated image.

Specific implementation code:

(1) Add a 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 (); // clear the content of the original p tag $ ("p. loadPhoto "pai.html (" <iframe width = 520 height = 400 name = \ "touzizuhe \" id = \ "touzizuhe \" frameborder = 0 src = "generate image address"> </iframe> "); // Add the jquery Statement of iframe });

Note: After the iframe is developed, the address of the generated image is automatically accessed, so that the image generation needs to be met.

The iframe operation in jQuery (click the button to add a window) will introduce you so much, I hope it will 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.