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!