Nice track

I stumbled upon this site SoundCloud and found a very cool fusion. I would like to share that here.

Advertisements

JQuery – Click event firing more than once

I had to use jQuery for a project.

I attached a click event to an element


$('#test a').click(function()
{
  $(this).children('img').attr("src","images/open.gif");

});

The problem i faced was that the click event was called more than once.

After a long search,got a solution and may this help one of u too.

.unbind did the trick 🙂


$('#test a').unbind("click").click(function()
{
  $(this).children('img').attr("src","images/open.gif");

});