Question

I'm using Jssor for image slideshow.It is fine.

I'm trying to do showing image name in end of url ( www.example.com/gallery/test#1.jpg , www.example.com/gallery/test#2.jpg ..)

Is this possible with jssor slider or any other ways to approach this. please suggest any ideas.

Was it helpful?

Solution

Jssor or any slider plugin should be fine if you are comfortable with the kind of effects offered by it.

Coming to second part of your question. You can store all the image names in some js array in same order as html. Then write an event handler for

slider1.$On($JssorSlider$.$EVT_PARK,function(slideIndex,fromIndex){});

which is fired when each slide changes. In the callback for this event you get slideIndex which you can use to get the image name from the array you created. You can then change the url anchor using

location.hash = 'imagename.jpg';
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top