js 动画提示数据有变化

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内容发生了变化,那么就将字体先变大一点,再恢复之前大小。

支持以下属性

其他支持样式,可以使用jqueryui
https://jqueryui.com/animate/

posted @ 2020-02-27 21:48  zhaogaojian  阅读(249)  评论(0编辑  收藏  举报