Les fiches didactiques. Trucs et astuces pour Webmaster. Les Gadgets Google et les Gadgets Blogger
Running ...

Dynamic content with iframe


  • Click the link on the left, to change the contents



The iframe


  • Create the iframe, with an initial content :

<iframe
name="NAME_OF_FRAME" id="NAME_OF_FRAME"
src="URL of content"
width="xxx" height="xxx"
scrolling="no"
frameborder="no">
</iframe>


Changing the content of iframe


  • Create a normal anchor :

<a href="URL of content"
title="text for link"
target="NAME_OF_FRAME">Link</a>



Style for the content


  • Create an html page, with this style :

html
{
margin:0px;
padding:0px;
overflow: auto;
border: none;
}

body
{
width: xxxpx;
height: xxxpx;

margin: 0px 0px 0px 20px;

overflow: auto;
}



Creating an Ads Rotator


  • Using this technique, Math.random and window.setTimeout, it's easy to create an Ads Rotator :
  • This iframe will reload its contents every 120 seconds



More Informations




One Day - One Label - One Wine




Find a Wine with Google CSE