let groupZiArray = $。。。。。;
for (let i = 1; i < groupZiArray.length; i++) {
let $groupZi = $(groupZiArray[i]);
//有变化的话进行提示
if ($groupZi.html() != ('子分组' + i)) {
$groupZi.animate({ fontSize: '18px' },
300,
function() {
$groupZi.html('子分组' + i);
$groupZi.animate({ fontSize: '16px' }, 300);
});
}
核心代码animate,代码效果是如果html内容发生了变化,那么就将字体先变大一点,再恢复之前大小。
支持以下属性
- backgroundPositionX
- backgroundPositionY
- borderWidth
- borderBottomWidth
- borderLeftWidth
- borderRightWidth
- borderTopWidth
- borderSpacing
- margin
- marginBottom
- marginLeft
- marginRight
- marginTop
- outlineWidth
- padding
- paddingBottom
- paddingLeft
- paddingRight
- paddingTop
- height
- width
- maxHeight
- maxWidth
- minHeight
- minWidth
- fontSize
- bottom
- left
- right
- top
- letterSpacing
- wordSpacing
- lineHeight
- textIndent
其他支持样式,可以使用jqueryui
https://jqueryui.com/animate/
来源:https://www.cnblogs.com/zhaogaojian/p/12374633.html