11-12-2008

Javascript resize frameset

the frameset can be set dynamically.

/* the frameset needs an id e.g. <frameset id='bl' rows='10%,*,10%" border='0' framespacing='0' frameborder='no'>
* then in javascript you can simply access it's rows property from child frames like so:
*/
 
 
parent.document.getElementById('bl').rows='1,*,1';

Comments:

5 comments.
Your comment:

»
Kumar Jain 10/08/2010, 9:20 am
This statement dose not work after frame resize manually. Have u any alternate ?
-- 14/08/2010, 11:13 am
You can prevent manual resize by adding a noresize attribute to the html frametag
Andrew 22/09/2010, 11:01 pm
Hi guys I was wondering if you have any quick solutions for dynamically setting the frame border using somesort of draggable image instead of the very nasty looking default frameset borders.

I am currently trying without too much success to use a jquery draggable to move a border aligned div I created in one of my frames. I am attempting to do this by capturing coordinates on the mouse click and release working out the offset and then setting the parent frames again in the same manner as the original post suggested...LOL obviously it is not working. There must be a simple way to get around this...(and no I cannot get rid of framesets at this point).
frameset 25/09/2010, 11:47 am
have you tried setting the frameset rows in a stop or drag event handler of the draggable?
Andrew 29/09/2010, 3:56 am
Yeah I was trying that but the problem I ran into and ended up spending a couple of days on was that as soon as the draggable div came close to the frame border everything would go haywire unless you move the cursor extremely slowly. The reason being that I couldn't get the frameset cols to update quick enough which meant the mouse would touch the border and the dragging event would not stop until you pulled the mouse back to the left frame and clicked again (i.e firing a mouseup for the stop).

 

[x]