Hover a td block
Is it possible to change TD background when you hover over it?
I have tried td:hover {background:red} and td a:hover {background:red}
without success.
Does this have to be done wi开发者_Go百科th javascript?
EDIT: restarted wamp now it works lol
yes its possible to change background color using jquery. please check the link http://inspectelement.com/tutorials/changing-the-background-color-of-a-page-using-jquery/
in this link it shows an example to change the background-color and image of the website. this will help you. change the constraint website background to the td you have. the website have an demo of the script working.
the jquery script in the link is actual if you click on a tab named blue it will remove other color css class and add a class showing blue.
before checking the script below please read the link. its relates to it you can use like this . i change the click command in the script given in the link page to mouseover
$(document).ready(function(){
$("li.one").mouseover( function(){ $
("body").removeClass('bg2 , bg3').addClass("bg1");
});
$("li.two").mouseover( function(){ $
("body").removeClass("bg1 , bg3").addClass("bg2");
});
$("li.three").mouseover( function(){ $
("body").removeClass("bg1 , bg2").addClass("bg3");
});
});
精彩评论