jquery animate .css

前端 未结 5 1460
醉梦人生
醉梦人生 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:18

    The example from jQuery's website animates size AND font but you could easily modify it to fit your needs

    $("#go").click(function(){
      $("#block").animate({ 
        width: "70%",
        opacity: 0.4,
        marginLeft: "0.6in",
        fontSize: "3em", 
        borderWidth: "10px"
      }, 1500 );
    

    http://api.jquery.com/animate/

提交回复
热议问题