I use Durandal (requireJS + knockoutJS) with jQuery
jquery 1.10.2 + knockoutjs 2.3.0 + requirejs
even a simple code won't work
$('#table1').scroll(function(){
alert('');
});
even fadeOut(); fadeIn() are not working
but EACH function is working properly
$('.items').each(function(){
$(this).css("display","none");
});
any guess? thanks
If your DOM is being loaded after that JQuery event handler is wired up, it won't wire up at all (e.g. if the 'table1' table is added after you've added that event handler because it's loaded via AJAX or similar). Instead, you'll need to do some kind of event delegation. The easiest way to do this is to attach the event to something that will exist (document is an obvious one), and filter the event handler. e.g.
That way, because document actually handles the event, it doesn't matter that 'table1' is added later as that filter is evaluated at the time the event handler is fired.