So I have element blocks being added dynamically (<div><img><div><p></p></div></div>) and once they load, I change the ID of them ($(“#”+id).attr(“id”, new_id);) I’m having an issue selecting that new ID though. Selecting the old ID still works and applies to that element. How do I make it recognize the new ID?
Site is at http://www.steamcompare.com. You can test by adding a steam account. While it’s loading, I display an image with a transparent overlay. Once it finishes, I fadeout the overlay, change the ID, and add a bunch of information to the overlay. When you hover over it again, you’ll see the extra info. Now, if I fadeout the overlay with
$("#"+id).find('div.caption').fadeOut(200);
before I change the ID, it’s fine. If I move it past, it won’t fadeout.
Never did resolve this, ended up having to rewrite how I was handling the elements. Solved it by destroying the original one and creating a new one in it’s place with the new ID.