View Single Post
  #1  
Old 01-16-2008, 01:10 PM
 
dgallek dgallek is offline
 

Member
  
Join Date: Mar 2007
Posts: 10
 

Default adding javascript to customer home.tpl

Hi All,

I'm trying to get two javascript functions to run on the home.tpl

I've put the relevant script info between the "literal" tags as below:


Code:
</title> {include file="meta.tpl" } <link rel="stylesheet" href="{$SkinDir}/{#CSSFile#}" /> {literal} <script 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> <script type="text/javascript" src="../../template-files/p7pm/p7popmenu.js"></script> <link rel="stylesheet" href="../../template-files/p7pm/p7pmh0.css" TYPE="text/css" MEDIA="screen" /> <style type="text/css" media="screen"> <!-- @import url("../../template-files/p7pm/p7pmh0.css"); .style3 {color: #000000} h1 { font-size: 16px; color: #FFFFFF; } h2 { font-size: 14px; color: #000000; } h3 { font-size: 18px; color: #FFFFFF; } .style4 {color: #FFFFFF; } --> </style> </literal> </head>

And, I've added the onload call in the body tag:

Code:
<body{$reading_direction_tag}{if $body_onload ne ''} onload="javascript: MM_preloadImages('../../template-files/2newsletter.jpg','../../template-files/2festool.jpg','../../template-files/2internetstore.jpg','../../template-files/2flitch.jpg','../../template-files/2cart_empty.gif');{$body_onload}"{/if}> {include file="rectangle_top.tpl" } {include file="head.tpl" }

When I view the page at http://www.hearnehardwoods.com/xcart/home.php?shopkey=9779

Everything works except the dropdowns for:
Homepage Our Woods Internet Store Customers Contact Us

and

the rollovers (Dreamweaver) just above the menu and to the right (there are 4 image buttons with text on them)

Everything works correctly here:
http://www.hearnehardwoods.com/about_us/policies.html

I'm running XCart Gold version 4.1.6

Thanks in advance,
Debra
__________________
X-Cart v4.1.6
Reply With Quote