June 04, 2004
A Newbie Tutorial
Setting Up the Frame
<iframe name="sidebar" id="sidebar" align="top" allowtransparency="true"
marginwidth="4" width="100%" height="750"
scrolling="auto" frameborder="0"
src="/cgi-bin/Amazon/amazon_heavy_products_feed.cgi?
mode=blended&search_type=SimilaritySearch&input_string=%%Asin%%
&templates=4&link_templates=1&max_results=6&link_max_results=10">
Sorry, your browser does not support IFRAMEs
</iframe>
So we have a child frame appearing in the parent window with the following configuration
- An IFRAME named "sidebar" (we'll be using that later),
- that will hopefully force itself to display at the top of the sidebar
- it's transparent so whatever colour our sidebar is will show through
- as wide as the parent sidebar (less 4 pixel margins on each side)
- will automatically put up scroll bars if there's more data than fits in the frame.
- won't have a border because we already have one in the parent sidebar.
- browsers which don't support IFRAMES will display the message instead.
We've configured our IFRAME to be 750 pixels in height. That's fine when you know how much data the search will return, but we don't. In order to make it resizable, we have to get the IFRAME window and its parent window to have a conversation. "Hey Dad!" "Yes, son?" "I need to be T H I S B I G !!!" Except they're going to talk in javascript. There's a simple example of this here found on this page. I'd save you all the digging, but the code's Terms of Use prevent me from redistributing it. Instead, I'll tell you what you need to do.Resizable IFRAMEs
- First, view the source code of this page and find the line
<script type="text/javascript">
Copy that line and everything following it until you get to</head>
and paste the whole block into your parent page somewhere inside the the <head> container. Posted by Patrick at June 4, 2004 09:46 PM | TrackBack
Trackbacks: Blogs linking to this entry.
