I am using jQuery to change the css of some element while hovering on other element and I am getting this error in the Chrome developer tool:
“Uncaught TypeError: Object .gearImg has no method ‘css'”
here is my css code:
.gearImg{
position: absolute;
z-index: 10;
top: 2px;
right: 10px;
opacity: 0.5;
}
and here is my jquery code:
$('#settings_div').hover(function(){
$(this).show();
alert(('.gearImg').css('opacity')); //alerting to find the problem, should show 0.5
},
function(){
$(this).hide();
('.gearImg').css('opacity', 0.5);
});
Where is the problem?
Thanks
Try this please : demo http://jsfiddle.net/VGAv8/
$missing — if you are further curious as to what is$read this What is the meaning of "$" sign in javascriptRest should fit the cause
:)code