javascript - Daily iframe content with auto resize -


i need daily iframe content script auto resize. i've been tried many ways that. nah.

here full code (http://dynamicdrive.com/dynamicindex17/dowiframe.htm):

<html>  <body>     <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 add iframe in firefox 1.0+ browsers          function startdyncode() {             dyniframesize()         }          function dyniframesize() {             var dyniframe = new array()             (i = 0; < 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)      </script>      <script language="javascript1.2">          //daily iframe content- © dynamic drive (www.dynamicdrive.com)         //for full source code, , terms of use, visit http://dynamicdrive.com         //this credit must stay intact use          var ie = document.all && navigator.useragent.indexof("opera") == -1         var dom = document.getelementbyid && navigator.useragent.indexof("opera") == -1          //specify iframe display attributes         var iframeprops = 'width=150 height=150 marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="1" scrolling="no"'          //specify 7 urls display inside iframe, 1 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 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>  </body> </html> 

auto resize doesn't work code. have do?

can help?


Comments