PDA

View Full Version : [DHTML] Cmotion Major Upgrade



jscheuer1
08-06-2006, 05:52 AM
1) CODE TITLE:Cmotion Major Upgrade

2) AUTHOR NAME/NOTES: DD and jscheuer1

3) DESCRIPTION: A major upgrade to this already fine script:

Allows for easy optional centering.
Percentage width may be used for the gallery to resize with the browser window.
Image train may be started left, center or right.
Eliminates 'b has no properties' error.


4) URL TO CODE:

http://www.dynamicdrive.com/forums/showpost.php?p=46958&postcount=3

or see demo:

http://home.comcast.net/~jscheuer1/side/files/cmotion_start_choice_auto_width.htm

shachi
08-06-2006, 07:29 AM
Great work jscheuer1!!:)

Twey
08-06-2006, 02:03 PM
Nice. I see you've appropriately removed the "not the author of any DD scripts" line from your signature too. :)

ddadmin
08-06-2006, 04:45 PM
Nice update! Subtle but no doubt much requested features. I'll definitely post it to DD in the next couple of weeks. I'll try and sync the vertical version to match this one too, assuming the changes are adaptable.

jscheuer1
08-06-2006, 08:18 PM
Thanks dd, etal!

The percentage width feature probably wouldn't translate well to a percentage height feature for the vertical version due to the innate differences between a page's height and its width as calculated by the browsers. Something different might be able to be worked out. It would work for a percentage of the height of a containing element with a set height but, that is almost the same thing as having a fixed height to begin with. The other additions/changes shouldn't be too much of a problem to adapt.

Twey
08-06-2006, 08:38 PM
Since it's using Javascript anyway, you may as well set the height as a specified percentage of the viewport's height.

jscheuer1
08-06-2006, 09:21 PM
Since it's using Javascript anyway, you may as well set the height as a specified percentage of the viewport's height.

Well, I thought about that but, that would be different on most pages than setting to a percentage of the view port width. Quite different in some cases.

Most pages' widths are the view port width. This can vary but, when it does it usually is acceptable, especially in any well designed page. This is not the case with a far greater number of page heights visa vis the view port height.

Mminnig
08-24-2006, 05:46 PM
What would I have to do in order to get two motion galleries to work on the same page?

Thanks,
Mike

Thumby55
08-25-2006, 12:59 AM
Quick n00b question for ya. I'm able to use this gallery when it's all by itself, but when I add it into an existing html page with various layers, it stops functioning. The images display properly but the scroll function does not work. Any tips?

jscheuer1
08-25-2006, 04:55 AM
To both Mminnig and Thumby55 -

Since DD has said that they will be adding this upgrade to the scripts library, if they haven't already, these type of questions would be better posed in the Dynamic Drive scripts help's main section. If the script isn't in the library yet, you can refer to this post as the URL of the script here on DD.

This sub forum is intended more for comments on the upgrade, rather than question about how to use it.

Thank you in advance for your understanding.

ratkinsonuk
09-01-2006, 09:02 AM
There is a bug in the current code, and can be seen on http://www.dynamicdrive.com/dynamicindex4/cmotiongallery.htm

"Line 168 - Invaild Argument"

Which is - cross_scroll.style.left=(menuwidth-actualwidth)/startpos+'px';

Rob.

Twey
09-01-2006, 04:06 PM
In which browser? Which version? What were you doing when the error appeared?

jscheuer1
09-01-2006, 06:47 PM
In which browser? Which version? What were you doing when the error appeared?

I think I see it, in FF it is reported as:


Error: Error in parsing value for property 'left'. Declaration dropped.
Source File: http://www.dynamicdrive.com/dynamicindex4/cmotiongallery.htm
Line: 0

and I get it in IE as line 169. But, since it only happens onresize, it must be that line (red) from the function:


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=(menuwidth-actualwidth)/startpos+'px';
}

which just happens to be line# 168 in motiongallery.js. I think it comes from dividing by zero which, in this case, produces negative infinity. The error disappears if 'startpos' is other than 0 in the configuration. So, you can make that line be:


cross_scroll.style.left=startpos? (menuwidth-actualwidth)/startpos+'px' : 0;

If that does in fact take care of the problem (should) and causes no new error(s), I would recommend that the demo page be updated with this fix.

Added Later: Seems to do the trick!

ddadmin
09-01-2006, 09:35 PM
Great, thanks John. Script on DD updated with this little fix as well.

chewbacka
09-26-2006, 06:28 PM
I'm trying to change the width of the main gallery/div. I've looked around the motiongallery.js and have had no luck. I did not changing anything within motiongallery.js. Can some one please help me. Thanx in advance

jscheuer1
09-27-2006, 06:16 AM
As this script is now available in the Dynamic Drive scripts library:

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

It would be better to post a question of this nature in the main Dynamic Drive Scripts Help forum.

The dimensions of the gallery are set in the gallerystyle.css file. If you need more help, please use the main help forum.

3bood
09-29-2006, 12:50 PM
i need to put an image above the scropt but i cant do .. can u help me ??

jscheuer1
09-29-2006, 05:00 PM
i need to put an image above the scropt but i cant do .. can u help me ??

Please use the main Dynamic Drive Scripts Help forum:

http://www.dynamicdrive.com/forums/forumdisplay.php?f=2

sabodj
10-13-2006, 04:27 AM
This works great in IE, however when I hover over the images in FF the border disappears and the image flickers.

jscheuer1
10-13-2006, 04:41 AM
This works great in IE, however when I hover over the images in FF the border disappears and the image flickers.

Does this happen on the demo page? If not, it is a problem with your implementation and it would be better to post a new thread in the main help section:

http://www.dynamicdrive.com/forums/forumdisplay.php?f=2

m93rd
10-20-2006, 04:54 AM
I would appreciate if any one can help make this script only scroll left and right when at the absolute ends (lefty / right)

Anotherwards I would like to have an left arrow and right arrow and it only starts scrolling left or right respectively when over the arrow. Instead of by cursor position. As I think this will be alot easier for the user to control and use.

Any help appreciated

m93rd
10-23-2006, 02:48 AM
any one?

really would appreciate it. I think it would be a cool addition or alternation to this script and sure others would also really appreciate it.

djr33
10-23-2006, 05:10 AM
Without looking at the code, the basic idea would be to totally rewrite how it detects the mouse. Additionally, what's the "absolute edge"? Thinking specifically and logically, you could either use the image to closest to the edge (which would become smaller and smaller until replace at which point it would be large again), or you could define an area, which would take a significant amount more code.

The basic point of the script, how I see it, is that it works like that. Though, it could probably be converted. Might there be something similar that does what you want instead? Not sure if you'll find anything, but you might want to look around for something like that.

And, sorry, I'm not how to do it. Javascript isn't really my area. I'd just pick at the code and see what I could do. But that's about it.

m93rd
10-23-2006, 05:27 AM
yeah I tried to look around, but surprisnly i coundn't find anything - considering I see this functionality on many sites.

What I want i guess is like
http://www.shopbop.com/lookbook/lookbook_main.jsp?FOLDER%3C%3Efolder_id=2534374302039870&lookFolderID=2534374302039870

djr33
10-23-2006, 06:44 AM
hmm.... ok.
Well... onMouseover on the two images is what sets the motion.
Just use the function for movement there, and that should be it.

Additionally, you should remove the code that exists now so it doesn't do anything. (I mean the code on the content onMouseover that causes the scroll.)

jscheuer1
10-25-2006, 06:04 AM
Please post these type questions in the main help section as requested by ddadmin for another thread in this section:

http://www.dynamicdrive.com/forums/showpost.php?p=58602&postcount=51

dmwhipp
11-02-2006, 08:17 PM
I love this script and am using it here:
http://www.lucchiniphoto.com/portfolio/families.html

Occasionally though, a picture will have a weird effect where you can see little random white squares. When I open the photo in my graphics program, there appears to be no problem, but it definitely looks funky on the site. Here's an example:
http://www.lucchiniphoto.com/portfolio/families.html
In the first photo of the couple with the dog, two dots appear on the guys sweater. On the 4th picture with the child's and adult's hands, the dots are almost tan, but when you click on the picture again in the lower slideshow, they become bright white.

Any ideas on what might be causing this and how to fix it?
Thanks,
Deborah

jscheuer1
11-02-2006, 10:30 PM
. . .a picture will have a weird effect where you can see little random white squares.

Any ideas on what might be causing this and how to fix it?
Thanks,
Deborah

That has nothing to do with the Cmotion script. It has to do with the fading of the larger images, is a known issue affecting only .jpg images faded in IE that have been processed since the original image (if it is a photo) was made.

There are ways to work with it but, please do not post help questions in this section of the forums. This section is for the release and upgrading of scripts.

dmwhipp
11-02-2006, 10:38 PM
Sorry - I just did a search and replied when I found this thread. I'll pay more attention next time.

macdeamon
03-12-2007, 09:30 AM
Hello.

Sorry for my english.
Thank you 4 the cmotionscript.It's great!!!

I use the cmotion script with a sql db.
When i click on a thumb in the carousel, the larger image is well displayed but the carousel(with the thumbs) return in the original starting position. And when you have many and many thumbs, you must slide and slide just to see the thumb who is after the first selected.

Is it possible that the carousel keep the position?

Thanks

macdeamon

gafitescu
03-17-2007, 03:43 PM
It's possible to make the script xhtml valid?
<nobr> is deprecated in xhtml...in rest it's a very usefull script

jscheuer1
03-17-2007, 04:17 PM
It's possible to make the script xhtml valid?
<nobr> is deprecated in xhtml...in rest it's a very usefull script

This is not the proper forum for help questions. I will tell you that virtually any script can be made to validate in any DOCTYPE and that XHTML isn't the best choice of DOCTYPE. I will also mention that just validating a script to a DOCTYPE doesn't necessarily make it truly valid for that DOCTYPE.

If you need more help, please post your question as a new thread in the main Dynamic Drive scripts help (http://www.dynamicdrive.com/forums/forumdisplay.php?f=2) section.