Change background image on link hover

后端 未结 4 1162
南旧
南旧 2021-01-26 10:53

So I have this problem, which I couldn\'t find, even though I did a thorough websearch.

I am making my portfolio, and the background is a picture of a woman, located in

4条回答
  •  清歌不尽
    2021-01-26 11:37

    Here's a generic jquery answer to your question:

    $('a.class').on('mousein', function(){
       $('#portfolio').css('background-image', 'url("other.jpg")');
    });
    $('a.class').on('mouseout', function(){, function(){
      $('#portfolio').css('background-image', 'url("woman.jpg")');
    });
    

提交回复
热议问题