View Full Version : Needing a little help with iframes and onmouseover/innerHTML changes.
Fou-Lu
01-27-2003, 01:03 AM
Yeah, so as stated above. I have this section, which I would like to us onmouseovers.
<span id="thisid"> </span>
<span align="center" onMouseOver="thisid.innerHTML='Yeah, your above me!'" onMouseOut="thisid.innerHTML=' '">Move Over Me!</span>
K, that should do for an example. So, originally, that would work no problem, if I move my mouse over the "Move Over Me!" it would change the innertext of what was stated above. So, I decided to move the <spans> with the onMouseOver effects into an iframe. How do I transfer the information from the iframe, to the <span id="thisid"> in the main document? Is this even possible to do?
ez4me2c3d
01-27-2003, 07:09 AM
the iframe has a name and id property .. like so..<iframe name="myFrame" id="myFrame" src="page.html"></iframe>so now when you code in the parent window you reference all the iframe ****.. i mean stuff like thiswindow.myFramelike in this example, check out how i reference the iframe
http://rap.midco.net/ez4me2c3d/html
Fou-Lu
01-27-2003, 09:48 PM
Though I do see what you are getting to, its the other way that I cannot get.
My span that I would like to change the HTML of is in the main browser window. And there is an imbedded iframe that I would like to roll my mouse over, and change the html in the main window. Here is how the code is looking:
<table width=75% border=1 cellpadding=4 cellspacing=0 bordercolor=#5A6C91 bgcolor="#C0C9E4" align="center" valign="top">
<tr colspan=3 valign="top"><td colspan="3" bgcolor="#B7C2DF" width=100% valign="top">
<b><font class="largefont">
<span id="change" name="change" class="change">
</span>
</td></tr><br><tr><td width="75%" bgcolor="#A5AECD" valign="top">
<Iframe width="100%" frameborder="no" name="mainframe" id="mainframe" src="mysource">
</iframe>
<noframes>Your Browers does not support iframes!</noframes>
</td>
</tr>
</table>
And for the iframe:
<html>
<body>
<font class="normalfont"><span align="" width="50%" style="cursor:pointer;cursor:hand"
onMouseOver="window.change.innerHTML='You are over me!'"
onMouseOut="window.change.innerHTML=' '">
<i>Put your mouse over me!</i></span><Br>
</body></html>
Now, there is an outside js file in that as well, its a link fader file. Shouldn't effect it though, me thinks. So, any idea?
I just broke the second code, so its easier to look at.
ez4me2c3d
01-27-2003, 10:51 PM
then all you need is to reference the main window with `parent`
as in .. parent.element.innerHTML = 'hello world';
get it?
Fou-Lu
01-27-2003, 11:04 PM
I'm not that great with iframes.
So I change the window.change.innerHTML with...?
Oh, nm. I feel stupid now.
Thanx a lot for the help buddy!
ez4me2c3d
01-28-2003, 03:02 AM
welcome
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.