PDA

View Full Version : CMotion Gallery and mouseover image interference



Noemie
12-09-2011, 02:30 AM
1) Script Title: CMotion Image Gallery

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex4/cmotiongallery.htm

3) Describe problem: This script has been working awesomely, until I added a new mouseover image outside of the gallery area (in a separate table cell). After that, it stopped scrolling. Is there some setting built in that prohibits mouseover images? I'm pretty new at this, and had some difficulty figuring out which changed caused this, as I was rebuilding an old page around my working CMotion script. I'm using Dreamweaver.
I tried adding a plain old image in that problematic cell, and all works just fine.
Any help would be much appreciated.

jscheuer1
12-09-2011, 03:33 AM
Sounds like an onload conflict. In motiongallery.js, using a text only editor like NotePad, change this highlighted line near to the end of the script:


creatediv();
positiondiv();
}
if (document.body.filters)
onresize()
}
window.onload=fillup;

onresize=function(){
if (typeof motioncontainer!=='undefined'&&motioncontainer.filters){
motioncontainer.style.width="0";
motioncontainer.style.width="";
motioncontainer.style.width=Math.min(motioncontainer.offsetWidth, maxwidth)+'px';
}
menuwidth=crossmain.offsetWidth;
cross_scroll.style.left=startpos? (menuwidth-actualwidth)/startpos+'px' : 0;
}

so that the code reads like so:


creatediv();
positiondiv();
}
if (document.body.filters)
onresize()
}
if (window.addEventListener){
window.addEventListener('load', fillup, false);
}
else if (window.attachEvent){
window.attachEvent('onload', fillup);
}

onresize=function(){
if (typeof motioncontainer!=='undefined'&&motioncontainer.filters){
motioncontainer.style.width="0";
motioncontainer.style.width="";
motioncontainer.style.width=Math.min(motioncontainer.offsetWidth, maxwidth)+'px';
}
menuwidth=crossmain.offsetWidth;
cross_scroll.style.left=startpos? (menuwidth-actualwidth)/startpos+'px' : 0;
}

The browser cache may need to be cleared and/or the page refreshed to see changes.

There may still be other problems. If you want more help:

Please post a link to a page on your site that contains the problematic code so we can check it out.

Noemie
12-09-2011, 06:47 PM
I figured out one issue: I had accidentally replace my mouse over script with the motion gallery script. I know it sounds really stupid, but I'm just figuring things out as I go along.
But, still, the scrolling script no longer works when I use the Dreamweaver "insert mouseover image too" so I will give this a try and see what happens.
Thanks for the quick answer!