jq设置html的fontsize,Jquery 设置字体大小(font-size)与行高(line-height)
Jquery 設置字體大小(font-size)與行高(line-height)
var cssfontSize=$(".txt_container").css('font-size');
var csslineHeight=$(".txt_container").css('line-height');
var unit=cssfontSize.slice(-2);
var fontSize=parseFloat(cssfontSize);
var lineHeight=parseFloat(csslineHeight);
if(c=="fontA_plus"){
if(fontSize>32)
return false;
fontSize=fontSize+2;
lineHeight=lineHeight+2;
}
if(c=="fontA_minus")
{
if(fontSize<18) return false;
fontSize=fontSize-2;
lineHeight=lineHeight-2;
}
$(".txt_container").css('font-size',fontSize+unit);
$(".txt_container").css('line-height',lineHeight+unit);
總結
以上是生活随笔為你收集整理的jq设置html的fontsize,Jquery 设置字体大小(font-size)与行高(line-height)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 如何查看iPhone 蓝牙耳机的电量
- 下一篇: 计算机网络发展第二阶段 兴起于,计算机辅