How to use Slider to show a series of images?

Dear Sirs

I’m sorry for asking a presumably elementary question, but I’m a novice in javascript programming.

There is a list of images in a folder, let’s say, ‘dog.jpg’, ‘cat.jpg’, etc. , and I would realize a web page showing your Slider control at its top and below an image, changing when Slider is dragged.

That’s what I’m planning:

placing file names in an array

var images = new Array ("dog.jpg", "cat.jpg", "horse.jpg");

showing images using

[code]


[/code]

Now, the question is: how can I link the slider position and the value of the index imgNum ?

I have been testing for a while in ‘04_linkto.html’.

Thank you in advance.

Hello
Here is a code demo for you:

[code]

[/code]

It’s exactly what I was looking for.
Thanks a lot !!

One more thing, if I may.

I would like to have the possibility to step forward the images clicking on them (it’s to say, jumping from 01.jpg to 02.jpg etc.).

I have tried:

onClick="document.getElementById('imgDiv').src = pictures[value++];

but it doesn’t work and Chrome shouts:

"Uncaught ReferenceError: value is not defined".

So, I have changed

slider.attachEvent("onChange", function(value){ document.getElementById("imgDiv").src = pictures[value];

in

slider.attachEvent("onChange", function(value){ document.getElementById("imgDiv").src = pictures[value]; myValue=value;
and used

onClick="document.getElementById('imgDiv').src = pictures[myValue++];

That way it works but slider’s position is, obviously, asynchronous respect to current image’s number. But it seems that

<img id="imgDiv" src="a 001.png" onClick="document.getElementById('imgDiv').src = pictures[myValue++];slider.setValue(myValue)"/>

fix the hurdle.

Am I omitting something ?

Could you provide current code result to inspect it and help you based on you case?

Please, get it from here: drive.google.com/open?id=0B9yg1 … 0FHaXQ5NlE

Sorry, there is no permission to access

I have attached the archive to this message. It cointains all code and readme file. Bye!
code.zip (19.5 KB)

Sorry, but your question doesn’t concern DHTMLX library directly, it’s more about web development in general. And unfortunately our support team won’t help you in this case. If you need help in your application development from our dev team, please contact us at sales@dhtmlx.com. Thank you for understanding.