[jQuery] Undo an div.remove() ?

Discussion in 'jQuery' started by 123GoToAndPlay, Jan 23, 2009.

  1. #1
    Hi all,

    How can i undo an div.empty??

    I use remove() to replace an image when a certain category is clicked. But i need to undo this once the particular category is not selected. For all other categories i show a flashSlideshow. The way i have it now the slideshow is being refreshed each time a new page is loaded. I don't want that.

    I am trying the function one() but this doesn't work.
    
    			if(url == "/content.php?category=news") {
    //static image
    				$("#flashContent").after("<div id='noFlashContent'></div>").remove();
    				$("#noFlashContent").html('<img src="/imgs/news.jpg" alt="static news" />');
    			}  else {
    				$("#noFlashContent").after("<div id='flashContent'></div>").remove()
    				$("#flashContent").one(showFlash());
    			}
    
    Code (markup):
    Any tips??
     
    123GoToAndPlay, Jan 23, 2009 IP