Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Jan 2005
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation *please help* - community website, amateur needs help

    Hi, I'm REALLY stuck on this one - if *anyone* can help I would be so appreciative. I want the javascript beneath "<!-- *column for sidebar comments etc -->" to work where it should but I seriously just cannot get it to work. It works if u cut and paste it into a brand new html document, but it won't work in here. *please* help, as I'm doing this site for free for a community organisation and don't have great skills in coding/javascript.

    Kind regards,
    Tim Graham.


    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>:: REspec ::</title>

    <script language="JavaScript" type="text/JavaScript">
    <!--
    function MM_swapImgRestore() { //v3.0
    var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
    }

    function MM_preloadImages() { //v3.0
    var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
    }

    function MM_findObj(n, d) { //v4.01
    var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
    if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
    for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
    if(!x && d.getElementById) x=d.getElementById(n); return x;
    }

    function MM_swapImage() { //v3.0
    var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
    if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
    }
    //-->
    </script>
    </head>

    <body>

    <!-- respec logo table -->
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td width="86%" height="153" align="left" background="img/starsrepeatingproper.gif"><div align="left"><img src="img/respecLOGO_PROPER.gif" width="620" height="153"></div></td>
    <td width="14%" align="left" background="img/starsrepeatingproper.gif">&nbsp;</td>
    </tr>
    </table>

    <!-- scrolling news/projects table -->
    <table height="52" width="100%" align="center" valign="top" bordercolor="#00bce5" background="img/stars_repeat_fade.gif" border="0">
    <tr>
    <td><table width="500" border="1" bordercolor="black" align="center" cellpadding="0" cellspacing="0" bgcolor="white">
    <tr>
    <td>
    stuff goes here
    </td>
    </tr>
    </table></td>
    </tr>
    </table>

    <!-- mainbody supertable -->
    <table width="100%" align="center" valign="top" border="0">

    <!-- *column for menu -->
    <tr>
    <td><table width="10%" height=400 border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td><table width="100%" border="0" cellspacing="1" cellpadding="0" bgcolor="#00bce5">
    <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="white">
    <tr>
    <td>

    <tr align="left" valign="top" bgcolor="#666666" border=0><img src="img/layout/8.gif" width="1" height="8" align"center"></tr>
    <tr align="left" valign="top" bgcolor="#FFE656" border=0><img src="img/layout/8.gif" width="1" height="8"></tr>
    <tr align="left" valign="top" bgcolor="#cccccc" border=0><a href="staff.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image23','','img/menu_staffrollover.gif',1)"><img src="img/menu_staff.gif" alt="Staff" name="Image23" width="186" height="23" border="0"></a></tr>
    <tr align="left" valign="top" bgcolor="#FFE656" border=0><img src="img/layout/8.gif" width="1" height="8"></tr>
    <tr align="left" valign="top" bgcolor="#cccccc" border=0><a href="Respecfactsheets.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image24','','img/menu_respecfactshhetsrover.gif',1)"><img src="img/menu_respecfactshhets.gif" alt="REspec Fact Sheets" name="Image24" width="186" height="23" border="0"></a></tr>
    <tr align="left" valign="top" bgcolor="#FFE656" border=0><img src="img/layout/8.gif" width="1" height="8"></tr>
    <tr align="left" valign="top" bgcolor="#cccccc" border=0><a href="progsandproj.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image13','','img/menu_progandprobrollover.gif',1)"><img src="img/menu_progandproj.gif" alt="Programs and Projects" name="Image13" width="186" height="23" border="0"></a></tr>
    <tr align="left" valign="top" bgcolor="#FFE656" border=0><img src="img/layout/8.gif" width="1" height="8"></tr>
    <tr align="left" valign="top" bgcolor="#cccccc" border=0><a href="comments.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image14','','img/menu_commentsroll.gif',1)"><img src="img/menu_comments.gif" alt="Comments" name="Image14" width="186" height="23" border="0"></a></tr>
    <tr align="left" valign="top" bgcolor="#FFE656" border=0><img src="img/layout/8.gif" width="1" height="8"></tr>
    <tr align="left" valign="top" bgcolor="#cccccc" border=0><a href="projectideasandcommneeds.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image15','','img/menu_projideasandcommprojro.gif',1)"><img src="img/menu_projideasandcommproj.gif" alt="Project Ideas and Community Needs" name="Image15" width="186" height="42" border="0"></a></tr>
    <tr align="left" valign="top" bgcolor="#FFE656" border=0><img src="img/layout/8.gif" width="1" height="8"></tr>
    <tr align="left" valign="top" bgcolor="#cccccc" border=0><a href="makeitanactiveday.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image16','','img/menu_makeitanactiverovet.gif',1)"><img src="img/menu_makeitanactive.gif" alt="Make It An Active Day" name="Image16" width="186" height="23" border="0"></a></tr>
    <tr align="left" valign="top" bgcolor="#FFE656" border=0><img src="img/layout/8.gif" width="1" height="8"></tr>
    <tr align="left" valign="top" bgcolor="#cccccc" border=0><a href="publications.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image17','','img/menu_publicationsrover.gif',1)"><img src="img/menu_pulbications.gif" alt="Publications" name="Image17" width="186" height="23" border="0"></a></tr>
    <tr align="left" valign="top" bgcolor="#FFE656" border=0><img src="img/layout/8.gif" width="1" height="8"></tr>
    <tr align="left" valign="top" bgcolor="#cccccc" border=0><a href="map.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image18','','img/menu_map_rover.gif',1)"><img src="img/menu_map.gif" alt="Maps" name="Image18" width="186" height="23" border="0"></a></tr>
    <tr align="left" valign="top" bgcolor="#FFE656" border=0><img src="img/layout/8.gif" width="1" height="8"></tr>
    <tr align="left" valign="top" bgcolor="#cccccc" border=0><a href="weblinks.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image19','','img/menu_websitelinksrover.gif',1)"><img src="img/menu_websitelinks.gif" alt="Other Website Links" name="Image19" width="186" height="23" border="0"></a></tr>
    <tr align="left" valign="top" bgcolor="#FFE656" border=0><img src="img/layout/8.gif" width="1" height="8"></tr>
    <tr align="left" valign="top" bgcolor="#cccccc" border=0><a href="contactus.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image21','','img/menu_contactus_rover.gif',1)"><img src="img/menu_contactus.gif" alt="Contact Us" name="Image21" width="186" height="23" border="0"></a></tr>
    <tr align="left" valign="top" bgcolor="white" border=0></p><a href="default.htm"><p align="center"><br><img src="img/gfx/home.gif" width="50" height="52" border="0"></p></tr>

    </td>
    </tr>
    </table></td>
    </tr>
    </table>
    </table></td>
    </td>

    <!-- *column for content -->
    <td valign="top" width="80%"><table width="100%" border="0" cellspacing="20" cellpadding="0" valign="top">
    <tr>
    <td width="100%" valign="top">

    stuff

    </td>
    </tr>
    </table></td>

    <!-- *column for sidebar comments etc -->
    <td valign="top" width="10%">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td><table width="100%" border="0" align="right" cellpadding="0" cellspacing="1" bgcolor="black">
    <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#CCCCCC">
    <tr>
    <td height=431 valign="top">
    <img src="img/layout/orange_fadetowhite.gif" width="95" height="120" align="top">
    <script language="JavaScript">

    var content='<p>Visit <a href="http://www.javascriptkit.com">JavaScript Kit</a> for JavaScript tutorials and over 400 <font color="#FF0000">free</font> scripts</p><p><a href="http://freewarejava.com">Freewarejava.com</a>- direct links to Java applets and resources</p><p>Stay up to date on current news and events. Visit <a href="http://www.msnbc.com">MSNBC.com</a></p><p><a href="http://www.dynamicdrive.com">Dynamic Drive</a> is your definitive source for DHTML scripts and components.</p>';

    var boxheight=430; // BACKGROUND BOX HEIGHT IN PIXELS.
    var boxwidth=95; // BACKGROUND BOX WIDTH IN PIXELS.
    var boxcolor="#FFF6e9"; // BACKGROUND BOX COLOR.
    var speed=50; // SPEED OF SCROLL IN MILLISECONDS (1 SECOND=1000 MILLISECONDS)..
    var pixelstep=2; // PIXELS "STEPS" PER REPITITION.
    var godown=false; // TOP TO BOTTOM=TRUE , BOTTOM TO TOP=FALSE

    // DO NOT EDIT BEYOND THIS POINT

    var outer,inner,elementheight,ref,refX,refY;
    var w3c=(document.getElementById)?true:false;
    var ns4=(document.layers)?true:false;
    var ie4=(document.all && !w3c)?true:false;
    var ie5=(document.all && w3c)?true:false;
    var ns6=(w3c && navigator.appName.indexOf("Netscape")>=0)?true:false;
    var txt='';
    if(ns4){
    txt+='<table cellpadding=0 cellspacing=0 border=0 height='+boxheight+' width='+boxwidth+'><tr><td>';
    txt+='<ilayer name="ref" bgcolor="'+boxcolor+'" width='+boxwidth+' height='+boxheight+'></ilayer>';
    txt+='</td></tr></table>'
    txt+='<layer name="outer" bgcolor="'+boxcolor+'" visibility="hidden" width='+boxwidth+' height='+boxheight+'>';
    txt+='<layer name="inner" width='+(boxwidth-4)+' height='+(boxheight-4)+' visibility="hidden" left="2" top="2" >'+content+'</layer>';
    txt+='</layer>';
    }else{
    txt+='<div id="ref" style="position:relative; width:'+boxwidth+'; height:'+boxheight+'; background-color:'+boxcolor+';" ></div>';
    txt+='<div id="outer" style="position:absolute; width:'+boxwidth+'; height:'+boxheight+'; visibility:hidden; background-color:'+boxcolor+'; overflow:hidden" >';
    txt+='<div id="inner" style="position:absolute; visibility:visible; left:2px; top:2px; width:'+(boxwidth-4)+'; overflow:hidden; cursor:default;">'+content+'</div>';
    txt+='</div>';
    }
    document.write(txt);

    function getElHeight(el){
    if(ns4)return (el.document.height)? el.document.height : el.clip.bottom-el.clip.top;
    else if(ie4||ie5)return (el.style.height)? el.style.height : el.clientHeight;
    else return (el.style.height)? parseInt(el.style.height)arseInt(el.offsetHeight);
    }

    function getPageLeft(el){
    var x;
    if(ns4)return el.pageX;
    if(ie4||w3c){
    x = 0;
    while(el.offsetParent!=null){
    x+=el.offsetLeft;
    el=el.offsetParent;
    }
    x+=el.offsetLeft;
    return x;
    }}

    function getPageTop(el){
    var y;
    if(ns4)return el.pageY;
    if(ie4||w3c){
    y=0;
    while(el.offsetParent!=null){
    y+=el.offsetTop;
    el=el.offsetParent;
    }
    y+=el.offsetTop;
    return y;
    }}

    function scrollbox(){
    if(ns4){
    inner.top+=(godown)? pixelstep: -pixelstep;
    if(godown){
    if(inner.top>boxheight)inner.top=-elementheight;
    }else{
    if(inner.top<2-elementheight)inner.top=boxheight+2;
    }}else{
    inner.style.top=parseInt(inner.style.top)+((godown)? pixelstep: -pixelstep)+'px';
    if(godown){
    if(parseInt(inner.style.top)>boxheight)inner.style.top=-elementheight+'px';
    }else{
    if(parseInt(inner.style.top)<2-elementheight)inner.style.top=boxheight+2+'px';
    }}}

    window.onresize=function(){
    if(ns4)setTimeout('history.go(0)', 400);
    else{
    outer.style.left=getPageLeft(ref)+'px';
    outer.style.top=getPageTop(ref)+'px';
    }}

    window.onload=function(){
    outer=(ns4)?document.layers['outer']ie4)?document.all['outer']:document.getElementById('outer');
    inner=(ns4)?outer.document.layers['inner']ie4)?document.all['inner']:document.getElementById('inner');
    ref=(ns4)?document.layers['ref']ie4)?document.all['ref']:document.getElementById('ref');
    elementheight=getElHeight(inner);
    if(ns4){
    outer.moveTo(getPageLeft(ref),getPageTop(ref));
    outer.clip.width=boxwidth;
    outer.clip.height=boxheight;
    inner.top=(godown)? -elementheight : boxheight-2;
    inner.clip.width=boxwidth-4;
    inner.clip.height=elementheight;
    outer.visibility="show";
    inner.visibility="show";
    }else{
    outer.style.left=getPageLeft(ref)+'px';
    outer.style.top=getPageTop(ref)+'px';
    inner.style.top=((godown)? -elementheight : boxheight)+'px';
    inner.style.clip='rect(0px, '+(boxwidth-4)+'px, '+(elementheight)+'px, 0px)';
    outer.style.visibility="visible";
    }
    setInterval('scrollbox()',speed);
    }
    </script>
    </td>
    </tr>
    </table></td>
    </tr>
    </table></td>
    </tr>
    </table>
    </td>



    </tr>
    </table>
    </body>
    </html>

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,043
    Thanks
    0
    Thanked 251 Times in 247 Posts
    You should not have cross-posted here. This is against forum rules. You should have asked the mods to just move the post here in JavaScript forum.

  • #3
    New Coder
    Join Date
    Jan 2005
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    sorry! my mistake!

    sorry for the mistake, i had it bookmarked in the wrong section so when i sent it i didn't realise it had gone to the wrong place! so i sent it to the right one but it stayed behind. i'm sorry to have done this, if you can remove the wrong one please do so.

    regards
    tim

  • #4
    Senior Coder
    Join Date
    Feb 2004
    Location
    Edinburgh
    Posts
    1,352
    Thanks
    0
    Thanked 0 Times in 0 Posts
    also use code tags when posting code. furthermore, only post the relevant code. you don't need every last bit of it. just enough to get the gist of how your page works. thanks.
    *keep it simple (TM)


  •  

    Posting Permissions

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