0

I have created a custom dropdown with ul/li/div which works fine, that dropdown is inside a page loaded in an iframe. Problem: to open the dropdown and see the items over the iframe. Right now what happen is that the iframe. I have just tried to change z-index without any success. any suggestions will be very helpful thanks

michele

enter image description here

2 Answers2

2

Using an iFrame? No, it's not possible.

@JKirchartz is correct. Check out:

Is there a way to have content from an IFRAME overflow onto the parent frame?

Community
  • 1
  • 1
Ryan
  • 579
  • 1
  • 5
  • 17
1

What you're suggesting is not possible, however there are other ways to set the parent content from within an iFrame.

I'd recommend you take a look at the window.parent property which allows you to manipulate the parent of the iFrame.

An example of the usage of this is:

index.html: (Parent)

<p id="test">Hello!</p>
<iframe src="otherpage.html"></iframe>

otherpage.html: (Child)

<script type="text/javascript">
    window.parent.document.getElementById("test").innerHTML = "Hello World!";
</script>

This example will change Hello! on the parent page to Hello World! from JavaScript code executed from within the iFrame. You'll be able to manipulate the <ul> tag this way using the innerHTML property to add new li tags and anything else that you wish to do with it.

Nathangrad
  • 1,426
  • 10
  • 25