I have some sliders on the page. Each slider has uniq id.
<div id="gallery-1"><div>
<div id="gallery-2"><div>
........................
<div id="gallery-10"><div>
And i have some functions (JQuery)
$('#gallery-1').royalSlider({....})
$('#gallery-2').royalSlider({....})
...............................................
$('#gallery-1').royalSlider({....})
If i have 10 slider on the page, i have to copy paste 10 fragmets JQuery code (as i have matched above). I want to use Regexp for $('#gallery-[/\d/]'). Can i create something like this, or mb there is another way?
$('#gallery-'+i)? Or even store all sliders IDs in an array and loop throught this array?$('#'+arrayID[i])Or use a common class to the sliders as suggested by Kevin B?