Jquery background animate

前端 未结 6 1350
暖寄归人
暖寄归人 2021-01-13 11:03

Is it possible to animate the background-color in jQuery, because it is not working.

$(\'#something\').animate({
    background :\"red\"
}, 1000         


        
6条回答
  •  走了就别回头了
    2021-01-13 11:25

    You can use CSS3 transitions for that same effect. your animate could be achived with

    #something {
      -webkit-transition: background-color 1s linear;
       transition: background-color 1s linear;
       background: red;
    
    }
    

    The only problem with this solution is IE<10 support

提交回复
热议问题