After following the instructions from the answer below:
http://bytes.com/topic/javascript/answers/153274-script-iframe-can-not-call-functions-defined-parent-document
I was able to have the child window perform the function in the parent window.
The function was to only have an alert window pop up as the child page was loading.
I easily modified this to my intention which was to have a parent function performed when the child window was clicked.
Using the body tag:
<body onclick="parent .FUNCTION NAME HERE()">
I first change the method in which the function would be triggered, all went well there. then I tried to change which function would be triggered. (Basically use the function I wanted to happen on click of the child window rather then the function from the test). Once I did this switch, nothing happens.
The site this is being used on is:
http://tylerpanesar.ca/
What I want is when the menu bar is opened, the user chooses a link and the menu closes and goes to that link. This already happens. However if the user opens the menu bar and then changes there mind and continues with the page the are currently on, the menu stays open.
The child window has the same code to call the parent function to call the menu.hide function, but it does not work.
Any help would be greatly appreciated.
Thanks in advance,
Tyler
http://bytes.com/topic/javascript/answers/153274-script-iframe-can-not-call-functions-defined-parent-document
I was able to have the child window perform the function in the parent window.
The function was to only have an alert window pop up as the child page was loading.
I easily modified this to my intention which was to have a parent function performed when the child window was clicked.
Using the body tag:
<body onclick="parent .FUNCTION NAME HERE()">
I first change the method in which the function would be triggered, all went well there. then I tried to change which function would be triggered. (Basically use the function I wanted to happen on click of the child window rather then the function from the test). Once I did this switch, nothing happens.
The site this is being used on is:
http://tylerpanesar.ca/
What I want is when the menu bar is opened, the user chooses a link and the menu closes and goes to that link. This already happens. However if the user opens the menu bar and then changes there mind and continues with the page the are currently on, the menu stays open.
The child window has the same code to call the parent function to call the menu.hide function, but it does not work.
Any help would be greatly appreciated.
Thanks in advance,
Tyler
Comment