declaring and running universal functions with iScroll & JQM
I'm trying to initiate the iScroll function as a universal function so that way, what ever element that has the class of .scroll, the element will be effected by the iscroll plugin. Here's the script that I use to declare the iScroll
$(document).delegate('#home','pageload', function(){
var myScroll;
myScroll=new IScroll('.scroll' , {
scrollbars: true,
mouseWheel: true,
interactiveScrollbars: true});
});
Now this works the first time I load a page with that element, but when I try to load the second page, which also has an id of #home, I get nothing. Now is this a problem with my naming convention or am I calling the function incorrectly? Any help is appreciated