I want to make a pop up display when a user clicks on an image. In this pop I will have an iframe to display content that the client itself will upload to the server. It should be seen with the effect called blur behind. I would like to do this with as little code as possible. I would like it to be with a simple script in the html. no css I attached sample image.
Well , a simple script in html and without css is an impossible combination for what you want. Some CSS is necessary because the Popup itself requires styling to be done.
Here I leave you a fairly minimalist example, which can serve as a basis for what you want, I have commented the code so that it is better understood. It is not the most complete, but it has what it takes and very few bytes are needed to implement it, which speeds up the page load. Of course you can take the other option and use a plug-in, taking on the extra weight that this brings to web applications. Luck!
Edition
I've added the button style, to round out the dialog a bit more. With respect to using an image instead of a button, the only difference is in which element I put the
id='abrir'
, that element that has that Id, will be the one that activates the dialog, you cannot use more than one, but it will not be difficult to adapt the code to use classes, which can be more than one per page.Salu2
You could use the jQuery UI dialog to show the popup
then apply the iframe inside it
Example of JQuery UI Dialog With Dynamically Loading an URL with an IFRAME
jQuery UI Dialog using iframe URL
there are several ways to implement it, but in all of them the url of the link is assigned in the iframe when the modal dialog is opened
To create the modal shadow you would use the
jquery Dialog modal form
it's just configuration of the modal itself when you open it
I answer "by hearsay", don't pay much attention to me:
I think you can't use CSS blur to modify elements "that are already placed", that is, you can apply a blur to a layer, so that it affects "what it will contain ", but not what "is already behind". And if you apply a filter to a parent layer, it propagates all the children so the iframe will be blurry as well.
To solve it you can create a "mu loco" function, which generates a DIV that occupies the entire screen, with an IFRAME of itself blurred, a DIV above it to avoid using it and that if clicked returns to normal, and on top of all the iframe you wanted.
Something similar to this, try it out that the snippet should not like the loading itself XD: