jQuery を使用して他の要素にカーソルを合わせているときに要素の css を変更していますが、Chrome 開発者ツールでこのエラーが発生しています: 「Uncaught TypeError: Object .gearImg has no method 'css'」 ここに私の CSS コードがあります:
.gearImg{
position: absolute;
z-index: 10;
top: 2px;
right: 10px;
opacity: 0.5;
}
ここに私のjqueryコードがあります:
$('#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);
});
問題はどこだ?
ありがとう