I'm using Google Maps API and have a lot of html that is injected through the script using .html() etc. I have a few triggers set up to select those elements that are injected in, but as the HTML isn't 'ready' or 'loaded' it, it fails to select.
I thought a simple $(window).load would've worked, but it doesn't seem to be.
This is my code so far:
$(window).load(function(){
$('ul.campaign-list li a').on('click', function (e) {
$("html, body").animate({ scrollTop: "300px" });
alert("Scrolls");
});
});
I am using .on, instead of .live() but I'm also guessing this would be the right way to do it. I added the alert(); in just to test my code but alas it still doesn't load.
Any ideas?
Thanks, R