1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

[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