I am trying to accomplish a tricky menu with mouseover effects on the home page, so that a shaped picture switches when you put your mouse over the link. I have it all working perfectly in a standard HTML page - JS mouseover script in the head tags, main starting image, image map to designate areas as links where the words are, and the mousover image code in the image map code so that as the map area is moused over the image switches. Like I said, works perfectly on a standard html page...
http://visamax.ca/site/mouseover.htm test page on same server, code in head of page. Voila, beautiful. I with malice aforethought did not make them preload, to speed page time, so slight delay but images aren't too big so no problem.
The problem comes when trying to make it run in CMSMS.... I tried putting the JS as a separate file, call to
Code: Select all
<__script__ type="text/javascript" src="uploads/Horizontal_dropdown/mouseover.js"></__script>
Doesn't work... no mouseover effect.
Tried
Code: Select all
{literal}<__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> {/literal}
Tried same code in html of home page. Also no joy....
HOW can I get the javascript to run on the page?? Or more precisely what is blocking the JS from working that I can unblock??
HTML Code is
Code: Select all
<img style="float: right;" usemap="#Image1Map" src="uploads/images/immigrationtocanada.jpg" border="0" alt="Immigration to Canada" width="525" height="425" />
<map name="Image1Map">
<area onmouseover="MM_swapImage('Image1','','uploads/images/immigrationtocanadah.jpg',0)" onmouseout="MM_swapImgRestore()" shape="rect" coords="52,14,231,75" href="index.php?page=immigration-to-canada" alt="Immigration to Canada"></area>
<area onmouseover="MM_swapImage('Image1','','uploads/images/businessimmigrationh.jpg',0)" onmouseout="MM_swapImgRestore()" shape="rect" coords="43,85,222,133" href="index.php?page=business-immigration" alt="Business Immigration Visas"></area>
<area onmouseover="MM_swapImage('Image1','','uploads/images/skilledworkersh.jpg',0)" onmouseout="MM_swapImgRestore()" shape="rect" coords="50,149,227,200" href="index.php?page=skilled-workers" alt="Skilled Worker Visas"></area>
<area onmouseover="MM_swapImage('Image1','','uploads/images/temporaryworkersh.jpg',0)" onmouseout="MM_swapImgRestore()" shape="rect" coords="36,211,232,264" href="index.php?page=temporary-workers" alt="Temporary Worker Visas"></area>
<area onmouseover="MM_swapImage('Image1','','uploads/images/familycategoryh.jpg',0)" onmouseout="MM_swapImgRestore()" shape="rect" coords="45,270,270,319" href="index.php?page=family-category" alt="Family Category Visas"></area>
<area onmouseover="MM_swapImage('Image1','','uploads/images/studentsh.jpg',0)" onmouseout="MM_swapImgRestore()" shape="rect" coords="64,324,277,365" href="index.php?page=students" alt="Student Visas"></area>
<area onmouseover="MM_swapImage('Image1','','uploads/images/canadianexperienceh.jpg',0)" onmouseout="MM_swapImgRestore()" shape="rect" coords="68,367,326,419" href="index.php?page=canadian-experience-class" alt="Canadian Experience Class Visas"></area>
</map>
CMSMS home page is http://www.visamax.ca/site/ As you can see, the menu works fine, just no mouseover effect.
I've done extensive searching with Google and through this forum trying to find the answer. Any questions I found on "how can I get JS mouseover" to work pertained to text, so the questioners were told to just do it with CSS instead. I've thought about it, but came to the conclusion this wasn't possible in this case.
So, HOW do I get JS mouseover code to be active in CMSMS???

Thanks in advance for any help....