Results 1 to 2 of 2

Thread: Iframe scrollbar color and Monthly iframe content

  1. #1
    Join Date
    Sep 2007
    Posts
    83
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Iframe scrollbar color and Monthly iframe content

    Is there a way to make the top script work with the bottom one (Monthly iframe content II)
    HTML Code:
    <html>
    <head>
    <title></title>
    <meta http-equiv="Content-Language" content="en-us">
    <meta http-equiv="imagetoolbar" content="no">
    /***********************************************
    * Scroll bar color mod on IFrame
    ***********************************************/
    <script type="text/javascript">
    
    window.onload = function(){
    if (!window.attachEvent||!document.fireEvent)
    return;
    ifr();
    var iframeElements = {
    a:document.getElementsByName('iframeprops')[0],
    };
    for (var i in iframeElements)
    iframeElements[i].attachEvent('onload', ifr);
    }
    var ifr = function(){
    var iecompattest = function(docObj){
    return docObj.compatMode && docObj.compatMode!="BackCompat"? docObj.body.parentNode : docObj.body;
    }
    	var iframeDocs = {
    	a:iecompattest(document.frames['iframeprops'].document),
    	};
    	for (var i in iframeDocs){
    		with (iframeDocs[i].style){
    			scrollbarArrowColor='#294B64';
    			scrollbarBaseColor='#EBF5FF';
    			scrollbarDarkShadowColor='#5A89AB';
    			scrollbarTrackColor='#88B8DE';
    			scrollbarFaceColor='#9bc7e9';
    			scrollbarShadowColor='#78ABD4';
    			scrollbarHighlightColor='#EBF5FF';
    			scrollbar3dLightColor='#78AAFF';
    		}
    	}
    }
    
    </script>
    
    <style type="text/css">
     body {
      background-color: #88B8DE;
     }
    </style>
    </head>
    <script type="text/javascript">
    /***********************************************
    * Monthly iframe content II-  Dynamic Drive DHTML code library (www.dynamicdrive.com)
    * This notice MUST stay intact for legal use. Modified for Months by jscheuer1
    * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
    ***********************************************/
    var ie=document.all
    var dom=document.getElementById
    
    //Specify IFRAME display attributes
    var iframeprops= 'width=100% height=100% marginwidth="5" marginheight="5" hspace="0" vspace="0" frameborder="0"'
    
    //Specify 12 URLs to display inside iframe, one for each month of the year
    var mnthcontent=new Array()
    mnthcontent[1]="1.htm"
    mnthcontent[2]="2.htm"
    mnthcontent[3]="3.htm"
    mnthcontent[4]="4.htm"
    mnthcontent[5]="5.htm"
    mnthcontent[6]="6.htm"
    mnthcontent[7]="7.htm"
    mnthcontent[8]="8.htm"
    mnthcontent[9]="9.htm"
    mnthcontent[10]="10.htm"
    mnthcontent[11]="11.htm"
    mnthcontent[12]="12.htm"
    //No need to edit after here
    if (ie||dom)
    document.write('<iframe id="dynstuff" src="" '+iframeprops+'><\/iframe>')
    
    var mydate=new Date()
    var myMonth=mydate.getMonth()
    
    function monthofyear_iframe(){
    if (ie||dom){
    var iframeobj=document.getElementById? document.getElementById("dynstuff") : document.all.dynstuff
    iframeobj.src=mnthcontent[myMonth+1]
    }
    }
    
    window.onload=monthofyear_iframe
    </script>
    </body>
    </html>

  2. #2
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Default

    Warning: Please include a link to the DD script in question in your post. See this thread for the proper posting format for asking a question.

    Remove this:
    Code:
    window.onload=monthofyear_iframe
    and replace this:
    Code:
    <script type="text/javascript">
    
    window.onload = function(){
    if (!window.attachEvent||!document.fireEvent)
    return;
    ifr();
    var iframeElements = {
    a:document.getElementsByName('iframeprops')[0],
    };
    for (var i in iframeElements)
    iframeElements[i].attachEvent('onload', ifr);
    }
    var ifr = function(){
    var iecompattest = function(docObj){
    return docObj.compatMode && docObj.compatMode!="BackCompat"? docObj.body.parentNode : docObj.body;
    }
    	var iframeDocs = {
    	a:iecompattest(document.frames['iframeprops'].document),
    	};
    	for (var i in iframeDocs){
    		with (iframeDocs[i].style){
    			scrollbarArrowColor='#294B64';
    			scrollbarBaseColor='#EBF5FF';
    			scrollbarDarkShadowColor='#5A89AB';
    			scrollbarTrackColor='#88B8DE';
    			scrollbarFaceColor='#9bc7e9';
    			scrollbarShadowColor='#78ABD4';
    			scrollbarHighlightColor='#EBF5FF';
    			scrollbar3dLightColor='#78AAFF';
    		}
    	}
    }
    
    </script>
    with this:
    Code:
    <script type="text/javascript">
    
    window.onload = function(){
    if (!window.attachEvent||!document.fireEvent)
    return;
    ifr();
    var iframeElements = {
    a:document.getElementsByName('iframeprops')[0],
    };
    for (var i in iframeElements)
    iframeElements[i].attachEvent('onload', ifr);
    }
    var ifr = function(){
    var iecompattest = function(docObj){
    return docObj.compatMode && docObj.compatMode!="BackCompat"? docObj.body.parentNode : docObj.body;
    }
    	var iframeDocs = {
    	a:iecompattest(document.frames['iframeprops'].document),
    	};
    	for (var i in iframeDocs){
    		with (iframeDocs[i].style){
    			scrollbarArrowColor='#294B64';
    			scrollbarBaseColor='#EBF5FF';
    			scrollbarDarkShadowColor='#5A89AB';
    			scrollbarTrackColor='#88B8DE';
    			scrollbarFaceColor='#9bc7e9';
    			scrollbarShadowColor='#78ABD4';
    			scrollbarHighlightColor='#EBF5FF';
    			scrollbar3dLightColor='#78AAFF';
    		}
    	}
    monthofyear_iframe();
    }
    
    </script>
    Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
    Currently: enjoying the early holidays :)
    Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •