PDA

View Full Version : Resolved Question about the CMotion Gallery and aut0-start



650WEA
05-05-2007, 02:41 AM
1) Script Title:
CMotion Gallery
2) Script URL (on DD):
http://www.dynamicdrive.com/forums/showthread.php?t=11839
3) Describe problem:
No problem I like the script a lot. But is there a parameter to create an auto start? That is to have the gallery start to move before an actual mouse-over. This was requested by a new client. And thank you for the script.

jscheuer1
05-05-2007, 03:58 AM
The script is now in the library (has been for awhile):

http://www.dynamicdrive.com/dynamicindex4/cmotiongallery.htm

To answer your question, add this code (red) to motiongallery.js:


if (document.body.filters)
onresize()
scrollspeed=2;
moveleft();
}
window.onload=fillup;

650WEA
05-05-2007, 08:24 PM
John, thank you very much.
It works well.

Now, a small additional request: code to continue the movement the user initiated after mouse out?

Gregg

jscheuer1
05-06-2007, 05:09 AM
function fillup(){
if (iedom){
crossmain=document.getElementById? document.getElementById("motioncontainer") : document.all.motioncontainer;
if(typeof crossmain.style.maxWidth!=='undefined')
crossmain.style.maxWidth=maxwidth+'px';
menuwidth=crossmain.offsetWidth;
cross_scroll=document.getElementById? document.getElementById("motiongallery") : document.all.motiongallery;
actualwidth=document.getElementById? document.getElementById("trueContainer").offsetWidth : document.all['trueContainer'].offsetWidth;
if (startpos)
cross_scroll.style.left=(menuwidth-actualwidth)/startpos+'px';
crossmain.onmousemove=function(e){
motionengine(e);
}

crossmain.onmouseout=function(e){
scrollspeed=2;
return;
stopmotion(e);
showhidediv("hidden");
}
}
loadedyes=1
if (endofgallerymsg!=""){
create . . .

Note: If you want the speed to stay the same as it was, skip scrollspeed=2. I liked using it to get the gallery moving at a nice average speed onmouseout.

650WEA
05-07-2007, 01:22 AM
You real outdid yourself there. It works as promised. Thank you again!

Gregg Di Lorenzo

unknown00
06-25-2009, 02:04 AM
sorry for bumping this old thread

i added

scrollspeed=2;
return;

and it doesn't work anymore. the entire script stops working and there is no scrolling at all

help? btw i'm using the newest firefox

jscheuer1
06-25-2009, 04:40 AM
Please start a new thread for a new question.