woolyg Posted July 6, 2008 Share Posted July 6, 2008 Hi, I have a page that is dynamically created, and at any given time there could be any number of DIVs set to display = "block"; I need to incorporate a script that, upon clicking a link say, closes all open DIVs. Each DIV is uniquely named. Has anyone ever done something like this before? - WoolyG Quote Link to comment Share on other sites More sharing options...
dannyb785 Posted July 6, 2008 Share Posted July 6, 2008 Yes, it's not too bad, but just like creating dynamic links(so that youd have to insert a closing </a> at the end) basically, whatever if statement you use to create the div, you need to use the same to insert the closing </div> wherever it would be inserted, if needed. so maybe something like this: if( $open_div == true ) { open div and do some stuff } blah blah whatever else if( $open_div == true ) { close div and whatever else you might need to do to finish it off } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.