Thursday, February 7, 2008

iFrame inside a Table inside a CSS Div - CONTINUED

OK, so I figured out that iFrames do not automatically adjust to their content, they stay a set size! That is why I was having problems getting the iFrame to adjust the size of the table and then the CSS Div...

So, I found some javascript that fixes that problem!

This guy has the solution on his blog:
http://neverbow.blogspot.com/2006/12/let-iframe-auto-adjust-its-height.html

Here's the gist of it, look on his blog for the full story:

Use javascript function below, to let iframe adjust its height automatically.

function SetCwinHeight(){
var cwin=document.getElementById("cwin");
if (document.getElementById){
if (cwin && !window.opera) {
if (cwin.contentDocument && cwin.contentDocument.body.offsetHeight)
cwin.height = cwin.contentDocument.body.offsetHeight;
else if(cwin.Document && cwin.Document.body.scrollHeight)
cwin.height = cwin.Document.body.scrollHeight;
}
}
}

Then, add html code of iframe. Don't foreget the attribute "onload". Of course, the id of iframe should match "cwin" in the function SetCwinHeight:

<iframe width="778" align="center" height="200" id="cwin" name="cwin" onload="Javascript:SetCwinHeight()" frameborder="0" scrolling="no"></iframe>

At the end, recommend a function used to get the object of a html element.

function GetObj(objName){
if(document.getElementById){
return eval('document.getElementById("' + objName + '")');
}else if(document.layers){
return eval("document.layers['" + objName +"']");
}else{
return eval('document.all.' + objName);
}
}


OK, it works great! Except for one thing...

Now when I open it, the page height auto-adjusts, but now my iframe content moves up in the iframe and some of it is cut off, but only in Firefox and Camino browsers...

Man, what a headache!!!

Hopefully I'll figure out how to fix it... I'll update later.

Wednesday, February 6, 2008

iFrame inside a Table inside a CSS Div

Ok, I have this really annoying problem. I've designed a site that is based on CSS, but part of the site has a table inside it. So, when you fill the table with content, the page expands to fill it, and the CSS Div adjusts accordingly. All good!

But, I needed to add an iFrame inside the Table, and now the iFrame does not expand the table like normal text or image content would, so it does not expand the CSS Div, so I have scrollbars in the middle of my page...

Arghhh!!!

I'll post if I find a way to fix it.

Peace!
nate

Friday, February 1, 2008

Flash SEO! Really!!!

OK, it seems that the perpetual problem with using Flash is that it's fairly difficult to optimize for the search engines, because most of your content is usually one one page, especially if your whole site is in Flash.

But, I have found a new product by Flashloaded that makes the content of your Flash site readable by Search Engines like Google. Plus, it also includes a Flash CMS (Content Management System), which allows administrators to change pictures and text in your flash movie directly from the website, rather than having to change them in Flash and then publish it to the web. This is great if you are giving control of a site to one of your clients and they do not have the technical skills to make edits in Flash.

The product is called fCMSPro. At their website you can test out the CMS system, as well as see examples of how Google reads and interprets the information.

You can check it out here:
http://flashloaded.com/flashcomponents/fcmspro/

Stock Photography, Illustrations, Flash Movies, Animation and much more!

I get nearly all my stock photography for my design work from iStockphoto... as do a lot of designers. But, I also get illustrations, flash animations and movies from iStockphoto. I use them to do flash photo galleries, for design elements on logos and illustrations, and it saves me a lot of time and effort on most of my projects...

Click the link below to check out iStockphoto:

View My Portfolio