Putting a large image on the same page as CMotion
In response to the original question in the thread about wanting to put a large image on the same webpage as the Cmotion scrolling image menu - I wanted to do the same but for various reasons didnt want to get into IFrames or var and arrays etc and the solution in the end was relatively simple adapting a freeware code I had used earlier and thanks to the versatility of the CMotion script and only requires a few lines of extra code.
In the head of your document paste the following:
------------------------------------------------
<SCRIPT LANGUAGE="JavaScript">
browserName = navigator.appName;
browserVer = parseInt(navigator.appVersion);
ns3up = (browserName == "Netscape" && browserVer >= 3);
ie4up = (browserName.indexOf("Microsoft") >= 0 && browserVer >= 4);
function doPic1(imgName) {
if (ns3up || ie4up) {
imgOn = ("" + imgName);
document.mainpic1.src = imgOn;
start();
}
}
</SCRIPT>
--------------------------------------------------------
doPic1 will be the main image on the wbepage next in the body of your document add a standard DIV entry for your main pic - this can be an introductory image to the gallery if you wish - e.g:
---------------------------------------------------------
<div style="position:absolute; z-index:7; visibility:visible; left:10px; top:10px; width:320px; height:240px"><img name="mainpic1" src="your image url & title" width="320px" height="240px">
----------------------------------------------------------
Change the position, width and height co-ords to suit your needs - then after the Cmotion gallery tab <nobr id="trueContainer"> add the following ahref to your motion menu images ....
-------------------------------------------------------------
<a href="javascript:doPic1('your img 1 src url and title');"<image src="your url and image 1 title">
<a href="javascript:doPic1('your img 2 src url and title');"<image src="your url and image 2 title">
and so on - mainpic1 will change to whatever menu image you click on - hope this is useful.
Well I never said I was Clever...
Excellent John... I'm still a relative beginner as must be painfully obvious! - but thats the joy of a forum on a excellent website like this - will amend my code accordingly as yours is much more elegant in its simplicity and function - Thanks