Sınıfın her satırındaki bir resmi değiştirmek istediğim yuvalarım var ancak geçerli komut dosyamda hiçbir şey olmuyor mu?Yuvalanmış satır sınıfını onclick olarak değiştir
$(document).ready(function() {
$(".star_gray").click(function() {
$(this).toggleClass('star_color');
});
});
HTML
<a href="#"> <div class="star_gray"></div></a>
CSS
.star_color {
position:absolute;
background-image: url(../img/star_liked.png);
width: 24px;
height: 23px;
background-repeat: no-repeat;
background-position: center;
right:5px;
}
.star_gray {
position: absolute;
background-image: url(../img/star_not_liked.png);
width: 24px;
height: 23px;
background-repeat: no-repeat;
background-position: center;
right: 5px;
}
star_gray önce standları, .star_gray stilleri sonra .star_color stillerini yerleştirin. @ Pimskie'nin cevabı doğru çözüm değil – AlmasK89