jQuery effects combination

I want to apply highlight and remove effects to the same dom. One after the other. Unfortunately the highlight effect is not visible as the remove gets triggered immediately after.

Any idea to delay the remove action?

$("#<%= dom_id(@stock) %>").effect("highlight", {}, 4000)
$("#<%= dom_id(@stock) %>").remove()

Answers


Problem is, .remove() can't be delayed. It is one of those functions that triggers right away, meaning .delay() does nothing.

However, JavaScript's setTimeout() function will:

$('#g').click(function(){
$("#hi").hide("highlight", {}, 4000)
setTimeout('$("#<%= dom_id(@stock) %>").remove();', 4100)
});

Here's an example of this on jsFiddle.


Need Your Help

JS: Click h1 to set display to none at another div

javascript css

I'm very new in scripting with js. My question is, how can i set an onclick at an h1, which set the display to none at another div?

Python - Placing a string that looks like json on a remote server but quotes are being stripped

python

I am placing a file on a remote machine using paramiko ssh as follows.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.