jquery让指定的元素闪烁显示的方法

软件发布|下载排行|最新软件

当前位置:首页IT学院IT技术

jquery让指定的元素闪烁显示的方法

上大王   2020-05-13 我要评论

本文实例讲述了jquery让指定的元素闪烁显示的方法。分享给大家供大家参考。具体如下:

这段jQuery代码非常简单,功能就是让指定的元素不断的变换颜色,闪烁显示,调用也非常简单。

jQuery.fn.flash = function( color, duration )
{
  var current = this.css( 'color' );
  this.animate( { color: 'rgb(' + color + ')' }, duration / 2 );
  this.animate( { color: current }, duration / 2 );
}
// //www.qb5200.com Then use the above function as:
$( '#importantElement' ).flash( '255,0,0', 1000 );

希望本文所述对大家的jQuery程序设计有所帮助。

Copyright 2022 版权所有 软件发布 访问手机版

声明:所有软件和文章来自软件开发商或者作者 如有异议 请与本站联系 联系我们