PDA

View Full Version : CMotion Image Gallery - thumb positioning



macdeamon
03-12-2007, 12:27 PM
1) Script Title: CMotion Image Gallery

2) Script URL (on DD): http://www.dynamicdrive.com/forums/showthread.php?t=11839

3) Describe problem:

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

jscheuer1
03-12-2007, 06:55 PM
The upgraded version of the script (linked to in your post) has been a part of the DD library for some time. Make sure that you are using the official version:

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

If you use the default method for displaying larger images, it generates a pop up. If you do it that way, Cmotion will not reset as you are describing. If pop ups are blocked though, it will do exactly what you say. Most people do not have pop ups blocked but, you could, if you prefer, use another display script instead of the pop up routine.

Ways of doing that are described here:

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

and another is here:

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

macdeamon
03-13-2007, 08:45 AM
Sorry, I did not express myself correctly.
I must pass by the URL to post my larger images.
Is it possible to keep the positioning of the thumbs as they were before clicking.
OR it is possible to pass thumb positioning by the URL


Thanks a lot

macDeamon

jscheuer1
03-13-2007, 05:09 PM
I must pass by the URL to post my larger images.

If you mean using the (server side and/or form) post method, why?

The script already allows you to do this:


<a href="javascript:enlargeimage('larger_image1.gif')"><img src="thumbnail_image1.gif" border=1></a>

Here (from the demo (http://www.dynamicdrive.com/dynamicindex4/cmotiongallery.htm), Step 2):


<nobr id="trueContainer"><a href="javascript:enlargeimage('dynamicbook1.gif')"><img src="dynamicbook1.gif" border=1></a> <a href="javascript:enlargeimage('dynamicbook1.gif', 300, 300)"><img src="dynamicbook1.gif" border=1></a> <a href="http://www.dynamicdrive.com"><img src="dynamicbook1.gif" border=1></a> <a href="#"><img src="dynamicbook1.gif" border=1></a> <a href="#"><img src="dynamicbook1.gif" border=1></a> <a href="#"><img src="dynamicbook1.gif" border=1></a> <a href="#"><img src="dynamicbook1.gif" border=1></a> <a href="#"><img src="dynamicbook1.gif" border=1></a> <a href="#"><img src="dynamicbook1.gif" border=1></a></nobr>

macdeamon
03-14-2007, 03:48 PM
We must post by URL as soon as an image of the carrousel is clicked because other elements change completely and because several SQL requests are carried out.

For this reason it would be necessary to be able to recover the current position of the carrousel, to post it by URL, and to re-initialize the carrousel with the new co-ordinates of positioning.

Thanks in advance

macDeamon

jscheuer1
03-14-2007, 06:22 PM
I'm not all that familiar with the server side post method in general and certainly not with the particular language, version and settings your page uses to carry this out.

I can tell you that the javascript value you seek is:

cross_scroll.style.left

This is both a setter and a getter, ex:


alert(cross_scroll.style.left)

will pop up a value like -200px. And:


cross_scroll.style.left='-100px'

will set the position to that value.

So you could grab your new post value by setting it something like:


<? set $new_post_val= ?>cross_scroll.style.left

and then later reset the position something like so:


cross_scroll.style.left='<? get $new_post_val ?>'

I stress something like as, like I said, I don't know how things are set up on the server side there and am not all that familiar with server side code in general.

sayrus
03-15-2007, 05:15 PM
Hello,

Thanks for your help, it works well now!

I had to add some lines in the js file to make it work with the serveur post.

Now the page can be loaded with a specific position in the CMotion gallery.

A really interesting project the CMotion gallery.

Thanks for all.

Sayrus.