How can dynamically resize a frame when the mouse passes over it?
How can dynamically resize a frame when the mouse passes over it?
That could get really complicated depending upon just what you mean but, a simple answer is to give the iframe a mouseover event that changes its width and/or height attribute values. Ex:
That will work in IE and FF but for Opera, you also need something like so on the page showing through the iframe:Code:<iframe id="theFrame" src="iframe_over_ex.htm" width="350" height="500" scrolling="auto" frameborder="0" onmouseover="this.width=550;"></iframe>
either added to the body tag as shown above or as a part of a script on or linked to the page. If it is used as a part of a script, the syntax would be different.Code:<body onmouseover="parent.document.getElementById('theFrame').onmouseover();">
- John________________________
Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
And the latter code won't work across multiple domains.
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
True, very little javascript works across domains - parent window to child window and visa versa.Originally Posted by Twey
Probably if you had a division around the iframe with some padding, you could work it out so that Opera wouldn't need any extra code on the content page but, it would require some extra code associated in some way with this container division of the iframe.
- John________________________
Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
In fact, if you were willing to give the iframe itself some fairly hefty padding, it could work in Opera without any code on the content page.
- John________________________
Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
Bookmarks