Reputation: 35
I have:
$(document).ready(function(){
$("#eventsContent").children().each(function(){
$(this).bind("mouseenter", function(){
$(this).css("background","#F5F5F5");
});
});
});
I have tried this a couple different ways, but this is the jist of what i've done.
I have a container div with numerous divs within it. I want to bind a MouseEnter event to each inner div respectively (and eventually a mouseout, once i see what's done it will be easy to expand upon).
Thanks for you help in advance.
Upvotes: 1
Views: 3497
Reputation: 871
Try a hover:
$(document).ready(function () {
$("#eventsContent").children().each(function () {
$(this).hover(
function () { $(this).css("background", "#F5F5F5") },
function () { $(this).css("background", "#000000") }
);
});
});
(Didn't test code)
Upvotes: 0
Reputation: 50318
$("#eventsContent div").bind("mouseenter", function(){
$(this).css("background","#F5F5F5");
});
Upvotes: 4