PDA

View Full Version : CMotion Image Gallery Frame Problem



builderbloke
09-04-2006, 07:56 PM
1) Script Title: CMotion Image Gallery

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

3) Describe problem: Downloaded the code and with the minimum of modifications (Like page background etc) was perfect for my needs - all was well in the html editor and on testing the page on the internet - until I added it to my website which uses frames for the website menu upon which the scrolling image menu dissapeared completely - tried the page by itself again in a seperate browser window without frames and was fine again - any idea why frames should stop this excellent script working and is there a remedy? Thanks

jscheuer1
09-05-2006, 02:53 AM
It really shouldn't. A link to your frameset that displays this problem would be required to figure this one out.

jscheuer1
09-05-2006, 03:18 AM
Stop the presses! This looks to be a minor bug in this script which I just recently rewrote. I never tested it in frames and had no reason to think that it would be any different in frames than on a regular page. In fact, it isn't, except in IE if the startpos variable is set to 0. Easy to fix though. There was another minor bug fix to this script recently and, as this fix will use that part of the code, best to be sure that you have the most recent update. Look at your onresize function (it's at the end of the script), make sure that the last line is as shown here:


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;
}

Now, on to the fix for your current problem. Just above the onresize function we have this:


loadedyes=1
if (endofgallerymsg!=""){
creatediv();
positiondiv();
}
}
window.onload=fillup;

Make it like so:


loadedyes=1
if (endofgallerymsg!=""){
creatediv();
positiondiv();
}
if (document.body.filters)
onresize();
}
window.onload=fillup;

builderbloke
09-05-2006, 11:07 AM
Hi John you're a hero - the amended 'lodedyes' works like a dream now - many thanks!