Not sure if this is possible but can you load and unload into a div on a jquery toggle?
something a bit like this?
$("#IDOFCLICK").live('click',function(){
$(this).toggleClass("active").('#IDOFDIVTOLOAD').load('PAAGETOLOAD').slideToggle("slow");
});
if you can I guess the above is not right, but, how would you also unload on the “reverse” toggle?
That won’t work. The
toggleyou’re using just toggles the class. There is atoggleevent you could use, but it is not supported bylive()to my knowledge.When you say
unloadI assume you want to empty the content of#IDOFDIVTOLOAD. If that’s right, you could try this:jQuery docs:
.is()– http://api.jquery.com/is/.empty()– http://api.jquery.com/empty/