ABSOLUTE CLEARANCE


この文書はAbsolute Clearance // ShaunInman.comの日本語訳です。

2004年7月21日12:39投稿

このエントリーの経緯を探しているのなら、私の前の投稿とそれに対するコメントを見てほしい。

Everything must go

インターネットはa tough crowdである。真剣に考えると誰が「戻る」ボタンを使っているだろうか?Hehe, a broken back button was not one of the things I was testing for when attempting to make my SI_clearAbsolutes() function work with user resized text. I’m certainly glad someone noticed before the script was put to use in a production environment.

But no worries, I managed to fix the broken back button issue by using a manner of location.replace() on the dynamically generated iframe. Oddly, this only works in Firefox when called in the global namespace and not when inside a function. Fortunately this requires only slight modification to the way the script is incorporated into the XHTML.

Instead of attaching the single JavaScript? file in the head it is now placed immediately before the closing body tag (something Scott Schiller recently suggested for IFR). This actually has two additional benefits (besides giving FireFox? users their back button, um…back). The absolutely positioned elements are cleared earlier, before onload and possibly before the browser’s initial page draw. And it doesn’t overwrite an existing onload handler. Sweet.

Enough talk, have at these samples Single instance Multiple, nested instances Oh and curiously missing from the previous post was packaged source. Just unzip, configure the SI_url variable in the JavaScript? file, upload to your server and then place the script tag immediately before the closing body tag of any document with absolutes to be cleared. Done.