I want to run some jquery code when DOM Ready. I used
angular.element(document).ready(function() {
$(".hover-brown").mouseover(function(e) {
if ($(e.target).closest('.hover-yellow').length == 0) {
$(this).not(".hover-yellow").css("background", "#e8e8e8");
}
}).mouseout(function() {
$(this).not(".hover-yellow").css("background", "white");
});
$(".hover-yellow").hover(function() {
$(this).css("background", "#e8e8e8");
}, function() {
$(this).css("background", "white");
});
});
and tried window.load as well but it runs before Dom is ready i.e it does not find the elements when this function run.
Note: the elements are the <li>elements with class hover-brown rendered in view using ng-repeat directive.