You could possibly do this, but it’s going to take a lot of fiddling
around in JavaScript. Basically, you would dynamically insert a guard
DIV over the top of any TD that contained an iframe.
You can do this using Protaculous to get Prototype.js into your page.
Note that this will kill ALL iframes in your page, so it’s using a
sledgehammer to kill a fly.
Download Protaculous from FreewayActions.com. Install it on your copy
of Freeway. Apply the Protaculous Action to your page, and make sure
that the Actions palette is open so you can see its interface. Set the
Library picker to prototype-packed.
Click on the top-most Function Body button, and paste in the following
lump-o-code:
var page = $('PageDiv');
$$('td, div').each(function(elm){
if(elm.down('iframe')){
var guard = new Element('div');
page.insert(guard);
guard.setStyle({
'z-index':1000,
'position':'absolute'
});
guard.clonePosition(elm);
}
});
This is going to load up an array of all DIVs and TDs on your page,
step through them one at a time, see if they contain any iframes, and
if so, create a covering DIV directly above each one in the z-index of
1000 (significantly higher than any other elements on your page).
This is going to run before anything displays in the browser, but it
has to inspect every single element of your page. If your layout is
even remotely complex, this will add a measurable amount of time to
your page load. You can speed it up somewhat by changing the second
line to only look in TDs (just remove the ‘, div’ part from the double-
dollar function) if you are certain that you aren’t placing any
iframes in DIVs.
Let me know how this works out for you, and also be sure to test on a
Windows browser. There have been some reports that the
document.observe method (what we use to load this script before the
browser even loads) is somewhat temperamental in certain versions of
IE. If you experience this, then the trade-off is to move this
function into the second Function Body instead. That runs after the
page has finished loading, which means that your iframes will be
“unguarded” for a moment, but it also will cause them to be guarded in
all browsers.
Walter
On Feb 13, 2009, at 11:10 AM, Gordon Low wrote:
Could there be a way to lock the layer to the (variable) position of
the iFrame?
freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options