The big box here - http://jsfiddle.net/uwL3q7un/ - turns orange when you roll over it. If you click the small box it sets a flag that I want to somehow change the hover behavior of the big box to turn black when you roll over it. I tried adding a class to box:hover
, as you can see, but that doesn't seem to work. Does anyone see a way to do this?
Thanks.
$(function(){
var flag=false;
$('#flag').click( function() {
if(!flag) {
$('#flag').css('background-color', 'red');
$('#box:hover').addClass('hoverBlack');
flag = true;
}
else {
$('#flag').css('background-color', 'white');
$('#box:hover').removeClass('hoverBlack');
flag=false;
}
})
});