3
It is possible to have a div
with a iframe
and only after the user has clicked on one of the links within the iframe
, would appear a div
to say fechar
and when the user clicked there, closed the div
fechar
and the div
which contained the iframe
?
The question is not this friend, what I really want is, ex: I have a youtube video and on top I have the div to cover the video and only when the person clicks on the advertising is opening another div to say to close, got it? : ss
– thecreator
Next, I updated the example, maybe it is close to what you want.
– Tobias Mesquita
That’s right, only when clicking a link inside the iframe appeared a div that said: Close, and when clicking there, close.. It is possible?
– thecreator
Yes, it is possible, for such in the place of calling the . confirm(), you would have to make this div visible, inside this div you would have a button or input[Submit] that would close both div and iframe.
– Tobias Mesquita
I made one last change, when I click on an iframe link and it navigates to this link, the message will appear to close. as I told you before, you only need a small script change to show a div instead of confirm.
– Tobias Mesquita
Can you help me with that in a jsfiddle please? and sorry :ss
– thecreator
Let’s go continue this discussion in chat.
– thecreator
@thecreator, here’s the change you requested: http://jsfiddle.net/0nh8ms29/1/
– Tobias Mesquita
There are only two problems friend, http://jsfiddle.net/0nh8ms29/4/ 1º the background of the modal "superimpose" the modal and the second is: In the upper left corner of the iframe you have facebook linkk, google+ etc.. If you click on one of these links you will go to an external page, and the button will not close.. what I wanted was that even if it was the target = Blank, that appeared the button close..
– thecreator
this is a limitation of CORS (cross-origin Resource sharing), you cannot manipulate the elements from within iframe when they belong to another domain.
– Tobias Mesquita
instead of
.load
I can’t put.click
?– thecreator