views:

35

answers:

1

I have this code, and I'm trying to add a fadeIn once the content.replace is fired.

I've tried quite a few ways, and can't seem to find the magic bullet.

function add_fields(link, association, content) {
  var new_id = new Date().getTime();
  var regexp = new RegExp("new_" + association, "g")
  $(link).parent().before(
    content.replace(regexp, new_id));
  }

:D

+1  A: 

Like this:

var newStuff = $(content.replace(regexp, new_id));
newStuff.hide().insertBefore(link).fadeIn();
SLaks
SLaks strikes again! :D Thanks so much friend
Trip