Loser's Guide to Life
This may be illegal or something but it seems to work, in case you ever have the following problem:
You have a page which displays in the iframe of another page, the so-called “parent”. This “child” page in turn has a toggle feature: you click on it to view a portion containing pictures of whatever which is normally hidden to preserve your tasteful layout. But the toggled part is going to make the child page taller while the iframe remains the same size as before, so some of the new part will be hidden. Moreover, you still want the new part to close any previousy-toggled portion of the child page. What to do?
Once again the answer is childishly simple and should only take a few weeks of messing around to discover.
First do the toggle thing; then adjust the height of the iframe; then close the other thing. The first and last are straightforward, because you merely add
right after the toggle command, whatever it is. For example:
What you do is insert an “if” clause in the command:
This “calcHeight()” is the function in the parent page that adjusts the iframe. But how do you sneak this clause in? I found that to be the tricky part, because it has to be tacked on to the toggle command as a sort of “Oh, and while you're up” gambit, and won't work with anything else. The complete command looks like this: