Click here to Skip to main content
15,902,492 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi,

I have a parent page where

XML
<frameset title="ParentFrame"  framespacing="0" rows="<%=Height%>,*">
    <frame title="Frame1"  name="Frame1" scrolling="no" src="frame1.aspx" noresize/>
    <frame title="Frame2"  name="Frame2" scrolling="no" src="frame2.aspx" noresize/>
    </frameset>
</frameset>



From Frame1.aspx, I want to show a modal transparent div on top of all the frames for a short time.

To do that I add a modal div to the parent page, and call the parent js function to display the modal div, but it can not identify div in the page in the first place.
Following is the code, ignore the syntax errors please.

<script language="javascript" type="text/javascript">
    function showmodaldiv()
{
    document.getElementById('Modaldiv').style.display='block'
}
</script>
<frameset title="ParentFrame"  framespacing="0" rows="<%=Height%>,*">
    <frame title="Frame1"  name="Frame1" scrolling="no" src="frame1.aspx" noresize/>
    <frame title="Frame2"  name="Frame2" scrolling="no" src="frame2.aspx" noresize/>
    </frameset>
</frameset>

  <div id="Modaldiv" class="Modaldiv">
            </div>
</html>


I could show modal div from all frames but one of them has scrolls which is not covered by the modal div from the individual frame.
So I am going for this approach where I want to show modal div from parent page itself.

How to make this work?
Is there any other alternative to show modal div on a parent page (with frameset)
Posted
Updated 8-Mar-11 6:48am
v2
Comments
aidin Tajadod 8-Mar-11 11:51am    
Are you sure you can reach th eparent function? I am doing something similar with no problem.
vjvjvjvj 8-Mar-11 17:16pm    
yes I can reach but document.getElementById('Modaldiv') does not succeed

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900