0

EDIT:: My brain's smoking :) Perhaps I'm looking at this from the wrong angle? We need the JQuery to initialise for each dynamically generated id. Do we have to run the JQuery for each and every id (ie. place it in our PHP loop)??

How can we make this JQuery script apply to a dynamically generated list of ids where the ids increase by 1 when looped with PHP?

Here's the JQuery:

$(document).ready(function(){ 
    $('#slider').unoslider({
                scale: 'true', 
                responsive: 'true',
                touch: 'true',
                preset: 'bar_fade_left',
                navigation: {autohide: true},
                slideshow: {speed: 5, timer: false},
                animation: {delay: 200}
  }); 
}); 

And here the dynamically generated ids:

<?php echo "<ul id="slider'.$counter.'" class="unoslider">";?>

Thanks for any help!!

Richard Tinkler
  • 1,635
  • 3
  • 21
  • 41
  • possible duplicate of [jquery or css selector? select all id's that start with](http://stackoverflow.com/questions/5002966/jquery-or-css-selector-select-all-ids-that-start-with) – Felix Kling Jul 30 '13 at 09:02
  • @Yellow Bird : id should fit every
  • element which has the format slider1, slider2, slider3, slider4 etc...
  • – Richard Tinkler Jul 30 '13 at 09:05