I know it's been asked quite a few times in this forum, but I haven't found a single solution that works.
I have multiple ids with the same class I want the IScroll to be applied on.
<div id="myid" class="myclass">
// content
</div>
<div id="myid-differentname" class="myclass">
// content
</div>
However, I cannot change the ids, and they are not in increasing number like myId1, myId2, etc... they have full names.
Looking at another thread in this forum (Trigger iScroll 4 on all elements with a certain Class) I haven't been able to make it work.
The code I used is (based on that thread):
$(document).ready(function() {
var myScroll = new Array();
$('.myclass').each(function(){
id = $(this).attr('id');
myScroll.push(new IScroll(id, { mouseWheel: true, scrollbars: true, interactiveScrollbars: true, scrollbars: 'custom' }););
});
});
Can anyone elaborate?