How do I write a function that, onmouseover;
Thanks in advance!
$('.whatever').on('mouseenter', function() {
$('img', this).css('opacity', '0.5');
}).on('mouseleave', function() {
$('img', this).css('opacity', '1');
});
However, you can do the same thing using using pure CSS:
.whatever:hover img { opacity: 0.5; }
Here is a possibility:
$("#yourDiv").bind("mouseover", function(){
$(this).find("img").css("opacity", "0.5");
});
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.