//Specify 7 URLs to display inside iframe, one for each day of week var daycontent=new Array() daycontent[1]="monday.htm" //Monday content daycontent[2]="tuesday.htm" //Tuesday content daycontent[3]="wednesday.htm" daycontent[4]="thursday.htm" daycontent[5]="friday.htm" daycontent[6]="saturday.htm" daycontent[0]="sunday.htm"
//No need to edit after here if (ie||dom) document.write('<iframe id="dynstuff" src="/" '+iframeprops+'></iframe>')
var mydate=new Date() var mytoday=mydate.getDay()
function dayofweek_iframe(){ if (ie||dom){ var iframeobj=document.getElementById? document.getElementById("dynstuff") : document.all.dynstuff iframeobj.src=daycontent[mytoday] } }
window.onload=dayofweek_iframe
</script>
A to opcja z automatycznym dostosowaniem wielkości okna - czyli wysokość i szerokość sama się dostosuje do wielkości okna.
<script type="text/javascript">
//ID of Daily Iframe tag: var iframeids=["dynstuff"]
var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1] var FFextraHeight=getFFVersion>=0.1? 16 : 0 //extra height in px to add to iframe in FireFox 1.0+ browsers
function startdyncode(){ dyniframesize() }
function dyniframesize() { var dyniframe=new Array() for (i=0; i<iframeids.length; i++){ if (document.getElementById){ //begin resizing iframe procedure dyniframe[dyniframe.length] = document.getElementById(iframeids[i]); if (dyniframe[i] && !window.opera){ dyniframe[i].style.display="block" if (dyniframe[i].contentDocument && dyniframe[i].contentDocument.body.offsetHeight) //ns6 syntax dyniframe[i].height = dyniframe[i].contentDocument.body.offsetHeight+FFextraHeight; else if (dyniframe[i].Document && dyniframe[i].Document.body.scrollHeight) //ie5+ syntax dyniframe[i].height = dyniframe[i].Document.body.scrollHeight; } } } }
if (window.addEventListener) window.addEventListener("load", startdyncode, false) else if (window.attachEvent) window.attachEvent("onload", startdyncode)