Change background image on link hover

后端 未结 4 1205
南旧
南旧 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:34

    Here's perfect tested solution:

    $(document).ready(function() {
    
            $('a.class').hover(
    
               function () {
                  $('#portfolio').css('background-image', 'url("other.jpg")');
               }, 
    
               function () {
                  $('#portfolio').css('background-image', 'url("woman.jpg")');
               }
            );
    
         });
    

提交回复
热议问题