jquery animate .css

前端 未结 5 1455
醉梦人生
醉梦人生 2020-12-05 13:55

I have a script:

$(\'#hfont1\').hover(
    function() {
        $(this).css({\"color\":\"#efbe5c\",\"font-size\":\"52pt\"}); //mouseover
    }, 
    function         


        
5条回答
  •  时光取名叫无心
    2020-12-05 14:34

    You could opt for a pure CSS solution:

    #hfont1 {
        transition: color 1s ease-in-out;
        -moz-transition: color 1s ease-in-out; /* FF 4 */
        -webkit-transition: color 1s ease-in-out; /* Safari & Chrome */
        -o-transition: color 1s ease-in-out; /* Opera */
    }
    

提交回复
热议问题