When i try to put more than one slider on my page only first one works. Is there any way to make all of them work at same time? After searching o stack overflow i found this
Please initialize multiple instances in following manner,
var jssor_slider1 = new $JssorSlider$("slider1_container", options1);
var jssor_slider2 = new $JssorSlider$("slider2_container", options2);
But where do i put this.Is it going to work because this solution was not accepted.There was no other answer as well.
@jcropp: "How do you set up multiple settings using the methods that use jQuery?" I do not use jQuery and jssor slider, I did own a slider without jQuery only JS, but:
One setting for all sliders with jQuery
1. All
<style>...</style>
cut and placed after last #slider1_container.After:
2. add:
That:
3. is replaced by that:
For everyone members: Why not work that?:
Very simple!
Every time you begin a work on your JSSOR workspace it always doesn't change the Id. The same ids on a page will interfere with one another. Hence, on your SLIDER OPTION, change the ID from 1 to a different something. And that's it.
I am using php to get information from a mysql database, and it will build several containers which at the end of them all include a slider (dynamically built with images from a folder - So, I don't know how many sliders I will have but I found a quick and dirty way to work around that.
I loaded all the javascript with 1 file, it's called sliders.js
it has all the original content:
So, when I load my HTML with PHP, its all original HTML - except the ID is dyanmiacally set depending on the ID of the information I get from database which keeps it unique, in my case the ID's are something like "GameID-2784" etc.
..........
As mentioned, I know it's a dirty way of doing it, But it's very easy and works real good if you're using a lot of sliders with the same options, and you simply just want to give them a 'class' --- and more importantly, do not know the ID's (so you can add them to the java-script.
Would be happy to hear if anyone has a simpler solution!
One setting for all sliders without jQuery:
Different settings for all sliders without jQuery: