怎么用手机做网站教程,北京装修公司口碑最好的是哪家,南昌网站设计建设,wordpress 怎么改字体先获取字体大小#xff0c;进行处理。再将修改的值保存。slice() 方法可从已有的数组中返回选定的元素。arrayObject.slice(start,end)。start 必需。规定从何处开始选取。如果是负数#xff0c;那么它规定从数组尾部开始算起的位置。也就是说#xff0c;-1 指最后一个元素进行处理。再将修改的值保存。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. Thisis some text. This is some text. This is some text. This is some text. This is sometext. 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. Thisis some text. This is some text.