oracle修改窗口字体大小,jQuery之字体大小的设置方法
先獲取字體大小,進行處理。
再將修改的值保存。
slice() 方法可從已有的數組中返回選定的元素。
arrayObject.slice(start,end)。
start 必需。規定從何處開始選取。如果是負數,那么它規定從數組尾部開始算起的位置。也就是說,-1 指最后一個元素,-2 指倒數第二個元素,以此類推。
end?? 可選。規定從何處結束選取。該參數是數組片斷結束處的數組下標。如果沒有指定該參數,那么切分的數組包含從 start 到數組結束的所有元素。如果這個參數是負數,那么它規定的是從數組尾部開始算起的元素。
jQuery代碼如下:
$(function(){
$("span").click(function(){
//獲取para的字體大小
var thisEle = $("#para").css("font-size");
//parseFloat的第二個參數表示轉化的進制,10就表示轉為10進制
var textFontSize = parseFloat(thisEle , 10);
//javascript自帶方法
var unit = thisEle.slice(-2); //獲取單位
var cName = $(this).attr("class");
if(cName == "bigger"){
textFontSize += 2;
}else if(cName == "smaller"){
textFontSize -= 2;
}
//設置para的字體大小
$("#para").css("font-size",? textFontSize + unit );
});
});
html代碼如下:
放大
縮小
This is some text. This is some text. This is some text. This is some text. This
is some text. This is some text. This is some text. This is some text. This is some
text. This is some text. This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text. This is some text. This
is some text. This is some text.
總結
以上是生活随笔為你收集整理的oracle修改窗口字体大小,jQuery之字体大小的设置方法的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 内蒙古一级计算机考试时间2015,201
- 下一篇: ip服务器ip地址信息配置,服务器ip地