Mouseover on radio button replacement?

2019-09-02 12:21发布

问题:

I'm using jQuery to replace my radio buttons on this page - http://www.justdoors.co/product-selection/ and was wondering if it would be possible to add a mouseover effect as well?

I would like for the grey arrows that turn green when selected to change to green on mouseover/hover as the user goes up and down the list.

回答1:

It seems like all your replaced radio buttons have the class "imageCheck" so you could bind the effect on mouseover/mouseout:

$('.imageCheck')
    .mouseover(function() { 
        $(this).attr("src", "/changedimage.jpg");
    })
    .mouseout(function() {
        $(this).attr("src", "/originalimage.jpg");
});


回答2:

You could always also use CSS, see an example here.