Recent Widgets


Register for DashboardWidgets

Recent Forums Posts

Partners


iCompositions

MacDesktops.net

RSS Showcase
RSS Comments
RSS Forums

This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies. Posted in: Widget Design

flip and fliprollie disappearing

Author Message
Mathiswrong



Joined: 10 Sep 2005
Posts: 5

Posted: Sat Sep 10, 2005 - 5:21 pm    Post subject: flip and fliprollie disappearing Reply with quote

I have an iframe embedded in a div layer and for some reason whenever I roll over the iframe my "i" disappears.

Here's the meat of my body.
<div id="front" onmousemove='mousemove(event);' onmouseout='mouseexit(event);'>
<img src="Default.png">
<div id='online'></div>
<div class='flip' id='fliprollie'></div>
<div class='flip' id='flip' onclick='showPrefs(event);' onmouseover='enterflip(event);' onmouseout='exitflip(event)';></div>
<div class='glist' id='glist' onload='list'></div>
<div class='main' id='main'><iframe src="http://www.republicpro.com/widget.html"</iframe></div>

</div>

<div id="back">
<div align="center" class="backimage"><span onclick="widget.openURL('http://www.republicpro.com/');"><img src="republic.png"></span></div>
<img class="backgroundImage" src="backside.png">
<div class="done" id="done"></div>
</div>



Any ideas?
View user's profile Send private message Send e-mail AIM Address Widgets
gandreas



Joined: 16 Jun 2005
Posts: 114

Posted: Sat Sep 10, 2005 - 6:41 pm    Post subject: Reply with quote

Welcome to one of the many problems with Widgets & <iframe>.

Basically, the "front" div says "when then mouse leaves my div, make the 'i' disappear".

You iframe is then nested inside the (a child of) the "front div", so you'd expect it to work.

However, and this is part of the ugly truth of iframes, is that they are actually also in the window's frame children (which is sort of like something that is at the "top level", above your HTML body). More importantly, while the iframe itself is inside the parent <div> ("main" in your case), the _contents_ of the iframe are in that separate frame. As a result, when you move the mouse over anything in the iframe, you are actually moving it over something that is no longer inside your "front" div (and thus, you leave the "front" div and so the "i" is made to disappear).

Basically, Widgets & iframes do not live together well. You are much better off by reading in the web page you want to embed via XMLHttpRequest, and then embedding the body of the web page inside the <div>. It's more work (and has it's own issues, obviously) but in many cases will work much better.
View user's profile Send private message Send e-mail Widgets
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.

 
Powered by phpBB © 2001, 2002 phpBB Group