Changing Body Font-Size based on Font-Family with jQuery

后端 未结 7 2117
日久生厌
日久生厌 2020-11-28 12:11

I\'m trying to use Myriad Pro as my primary font with Arial and such as a fall-back like so:

font: 13px \"Myriad Pro\", \"Helvetica\", \"Arial\", \"sans-seri         


        
7条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-28 13:00

    if($("body").css("font-family").indexOf("Arial") > -1 
       || $("body").css("font-family").indexOf("Helvetica") > -1) {
       $("body").css("font-size", "12px");
    }
    

    This works perfectly. I don't know why the guy who posted it chose to delete it..

    Edit: NickFitz is correct as it indeed does not work. Silly me, got excited and overlooked the wrong changes it was making.

提交回复
热议问题