Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有什么方法可以在高亮效果发生时更改 div 的文本,然后在完成后恢复为原始文本?
启动高亮效果的代码:
$("#myDiv").effect("highlight", {}, 3000);
试试这个。
var myDiv=$("#myDiv"); myDiv.data("old",myDiv.html()); myDiv.html("New text"); myDiv.effect("highlight", {}, 3000, callback); function callback(){ var myDiv=$("#myDiv"); myDiv.html(myDiv.data("old")); }
演示