View Full Version : Running two C Motion scripts!

Beta Cygni
11-03-2008, 04:29 AM
1) Script Title: C Motion

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

3) Describe problem:

How do i make 2 of these scripts run on the same page at the same time?

Sidenote: not compatible with Firefox 3.

11-03-2008, 03:46 PM
What do you mean, "not compatible with Firefox 3"? The demo page works fine in FF 3 here. Anyways, you would need to use an object oriented version of the script like:


Use your browser's 'view source' to get the code.

Beta Cygni
11-04-2008, 06:02 AM
is there a way to have the image content (<a href="#"><img src="photo5.jpg" border="1"></a>) in the html file? I have many many of these and also seprate galleries that go page by page.

11-04-2008, 07:21 AM
One of the nice things about this and many object oriented scripts is that nothing much happens until the onpage call. So yes, you can put your array(s) right on the page, ex:

<script type="text/javascript">

var gallery2=new Array();
// Use a space character between each image for this gallery? (use 1 for yes, 0 for no):
//define gallery's image train:
gallery2[0]='<a href="photo9_lrg.jpg" onclick="return enlargeimage(this.href, 319, 494);"><img src="photo9.jpg" alt="" border="1"><\/a>';
gallery2[1]='<a href="photo8_lrg.jpg" onclick="return enlargeimage(this.href, 335, 577);"><img src="photo8.jpg" alt="" border="1"><\/a>';
gallery2[2]='<a href="http://www.dynamicdrive.com"><img src="photo7.jpg" alt="" border="1"><\/a>';
gallery2[3]='<a href="#"><img src="photo6.jpg" alt="" border="1"><\/a>';
gallery2[4]='<a href="#"><img src="photo5.jpg" alt="" border="1"><\/a>';
gallery2[5]='<a href="#"><img src="photo4.jpg" alt="" border="1"><\/a>';
gallery2[6]='<a href="#"><img src="photo3.jpg" alt="" border="1"><\/a>';
gallery2[7]='<a href="#"><img src="photo2.jpg" alt="" border="1"><\/a>';
gallery2[8]='<a href="#"><img src="photo1.jpg" alt="" border="1"><\/a>';

new cmotiongallery(gallery2, 6, 7, 1000, 1, 500, 225)

Just take note that the / in </a> should be escaped <\/a> as shown above. This is only really required (as far as I've ever seen) for validation purposes, but is also considered prudent because some browsers might require it for script code of this type on an HTML page.

Beta Cygni
11-05-2008, 01:25 PM
these solutions work however when i load them into a DHTML window the gallery doesn't scroll i have to manually refresh that window for the gallery to work. Have i done something wrong?

Ive tried both methods of putting the script in the html and in the jscript.

example here (http://www.renaissancedesignsinc.com/home.html) click on weddings (top of menu)


example 2 here (http://www.renaissancedesignsinc.com/lightbox/weddings.htm) (root page)