PDA

View Full Version : 2 CMotion galleries on one page



harrymn
08-12-2008, 05:14 PM
1) Script Title: cmotion image gallery

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

3) Describe problem: 2 gallerys on one page

I would like two seperate image lines (scrolling) on a page but when an image is clicked on either of them the image is displayed in the same place, anyone know how to do this?

jscheuer1
08-12-2008, 11:56 PM
For the first part (more than one Cmotion Gallery on a page), it would be best to use an object oriented Cmotion script like:

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

Which was introduced here:

http://www.dynamicdrive.com/forums/showthread.php?t=13302

For the second part, you would want to configure the onclick event for each image in the both galleries.

To best determine how to do that, I would need to know what you mean by 'place' when you say:


is displayed in the same place

One way would be to have a display image somewhere on the page, like:


<img id="displayarea" src="whatever.jpg">

Then in the OO Cmotion script have like:


gallery[0]='<a href="photo1_large.jpg" onclick="document.getElementById(\'displayarea\').src=this.href;return false;"><img src="photo1.jpg" border="1"></a>';

for each entry. Get step one working first (two Cmotion Galleries on one page). If you have trouble with step two (or for that matter, step one), there are many ways things can be done, let me know.