Forum Moderators: open

Message Too Old, No Replies

Frame resizer toggle function

I must recognized wheter the frame is wider or shorter

         

asantos

7:34 pm on Jun 1, 2006 (gmt 0)

10+ Year Member



I have one link that calls the toggleFrame(); function.

This is my toggleFrame();


function toggleFrame() {
if (parent.document.body.rows=='25,*') {
parent.document.body.rows='95,*';
} else {
parent.document.body.rows='25,*';
}
}

It works pretty good, but i want to know if there's an alternative to check if the frame has been shorted or if it has got widder.

What could i change this condition for?
if (parent.document.body.rows=='25,*')

fabricator

3:47 pm on Jun 2, 2006 (gmt 0)

10+ Year Member



try this instead.

var open=false;

function toggleFrame() {
open=!open;
if (open) {
parent.document.body.rows='95,*';
} else {
parent.document.body.rows='25,*';
}
}

asantos

4:06 pm on Jun 2, 2006 (gmt 0)

10+ Year Member



nice option. im using it right now. of course, as it is a toggle function, i must re-set the flag value on each request (depending on the status).

Thanks!