Oct 9, 2009

iFrame It!

We will be using an iFrame in our group project so I decided to blog about it as it seems a very valuable tool to help keep a web page dynamic. iFrames, inline frames, are similar to standard frames except that they are smaller and more dynamic. It's like having a smaller browser page imbedded on a larger page. We've all browsed to a page and while reading it had to scroll down to read the full page. iFrames also help to eliminate this effect. You can view the frame with a scroll bar within the page. This is nice sometimes if you want to view something while not leaving a content area.

Example of an iFrame where content from another page is viewed:


Javascript can be used to load a frame very easily. There are two ways to do this. Here's a link to an example demonstrating the load of a new page into the iFrame using Javascript (the code is also available on this page):
http://www.dyn-web.com/tutorials/iframes/load.php

Another really cool feature about iFrames is that they can be dynamically generated which makes them a great option for 'tooltips'. If you hover over text or an object a little popup window appears with a picture or text.

One more cool feature with iFrames is that you can write a script to change the content of the frame daily. This would be helpful if you want to show a tip of the day. The code can be found here: http://www.dynamicdrive.com/dynamicindex17/dowiframe.htm

As you can see, iFrames are another great way to help keep web page elements dynamic. I'm sure there are even more uses for iFrames that I haven't covered but this is a start.

4 comments:

  1. This seems pretty cool. It something I might think about using that in my individual project since mine would include many paragraphs about the games.

    ReplyDelete
  2. Very interesting, there are so many things that you can do with a web page now it is a little over whelming. I wish I had the time to play with all this stuff…. Maybe after I graduate and setup my own web server.

    ReplyDelete
  3. Diane,
    Thanks for researching this. iFrames seems to be a very versatile item when impementing it into your page. Do you know if you can easily hide and unhide iframes?

    ReplyDelete
  4. Cool post Diane. I had used a google calendar during my first iteration and they gave me code with an iframe to use. I hadn't worked with one before; I just stuck the code they gave me into my page and it worked! Thanks for providing more insight :-)

    ReplyDelete