how would you get this code to work from an iframe to the parent page?
I'm Looking to get the 'onclick="My Code"' to apply for the parent pageHTML Code:<img src="Picture.png" onclick="My Code"/>
sorry, i really hope this is specific enough, thanx
how would you get this code to work from an iframe to the parent page?
I'm Looking to get the 'onclick="My Code"' to apply for the parent pageHTML Code:<img src="Picture.png" onclick="My Code"/>
sorry, i really hope this is specific enough, thanx
I believe you can use this:
window.parent.myfunction();
Note: iframes bring up security issues, but if both pages are from the same domain it should help.
Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
Clayf700 (02-06-2011)
sweet, ill give it a try
hmmm... actually i used this in the iframe code and it dosn't seem to be working:
know what's going on?HTML Code:<img src="Picture.png" onclick="window.parent.Appear('VideoFolder');"/>
I'm not sure. I'd suggest starting simple, with a dummy function like makealert() in which there is only the code alert('Hello World');. Once that works, see if you can combine it.
Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
alright, i'v already tried that and i don't think i told you enough on the first run. what this script does is simply make things disappear and appear by id, so i have dialogs by specific id's that disappear/appear by a special button located in an iframe, so here is the script making them disappear and appear:
so i want each button to be able to make a different object appear/disappear. and if i made a different section of the script for each dialog it would be massive, so i'm trying to find an easy way around. got any ideas?HTML Code:function Appear(itemID){ // Toggle visibility between hidden and visible if ((document.getElementById(itemID).style.visibility == 'hidden')) { document.getElementById(itemID).style.visibility = 'visible'; } else { document.getElementById(itemID).style.visibility = 'hidden'; } }
Bookmarks