jQuery突出显示效果,不会消失 [英] jQuery Highlight Effect with no fade away
本文介绍了jQuery突出显示效果,不会消失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想使用jQuery.effect('highlight')突出显示<span>
,但是一段时间后它会淡出.
I want to highlight a <span>
using jQuery.effect('highlight'), but it fades out after a period of time.
如何使突出显示保持不变?
How can I get the highlight to be persistent?
我的代码是:
$('span').live('click', function () {
$(this).effect("highlight", { color: "#ff3fff"});
});
推荐答案
我不认为突出显示效果具有持久状态,您可以设置背景颜色:
I don't think the highlight effect has a persistant state, you could just set the background colour:
$('span').live('click', function () {
$(this).css("backgroundColor", "#ff3fff");
});
这篇关于jQuery突出显示效果,不会消失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文