TheDesignspace
Swap style sheets in iFrame contents based on parent window size


June 16, 2004
CSS | Javascript | Web Building

Link to this javascript in the head of the iFrame content document (the child document).

// JavaScript Document

if (window.parent.screen.height >= 700) 

{ document.write('');
}
	
else {

document.write('');
}

Of course this could be used for redoing the styles of the iFrame contents based on any other property of the parent document as well. For example you could say

Parent.document.body.some.property= 'a value"
instead of
window.parent.screen.height
Posted by ellen at June 16, 2004 11:24 AM | TrackBack

 Comments
 Post a comment
Name:


Email Address:


URL:


Comments:


Remember info?