COURSE of the MONTH

JQuery Toggle-How do I tell if all toggled elements are hidden?

Hello Experts,

I have a (hopefully) fairly simple question. Below i have a simple JQuery toggle menu for a recipe display which actually functions quite nicely for what we need, and ties in with a print stylesheet. We had this page done and the client added an advertisement to the side of the page, "recipe-call". Since all recipes have images that pop up on the same side, we need to hide the "recipe-call" div when someone clicks on a recipe title to display it. We have that function done just fine. As it stands, "recipe-call" is absolutely positioned and everything is fine with it, but what we need to do is get it to show up again when all of the recipes are collapsed. How would we test to see if all of the DIV elements are collapsed? Would this be a simple IF statement? I've tried a few things and so far it's been a no-go.

Who is Participating?

the flag did not update magically each time you change/toggle something on the page :)

firstly you need to use it ONCe document is ready
secondly you need to understand toogle take time to change state (hidden or visible) of the element
the value of the flag need to be updated before toggle or at the end

before just put it before
at the end, use the callback function of the slideToggle