View Full Version : DHTML Modal Window 100% height

06-04-2009, 02:17 PM
1) Script Title: DHTML Modal window v1.1

2) Script URL (on DD): DHTML Modal Window (http://www.dynamicdrive.com/dynamicindex8/dhtmlwindow/dhtmlmodal.htm)

3) Describe problem: I would like to open an external link (http://www.mylink.com) in a modal window centered and at 100% of the screen height. Is this possible with this script. If yes, can someone post an example of the onclick coding. :)

06-05-2009, 05:18 PM
Well, you can call dhtmlwindow.setSize(w, h), and for the h parameter, use dhtmlmodal.docheightcomplete to get the height of the viewable screen. However, you must also account for the chrome area of the DHTML window, so taking that into account, it might look something like:

var agreewin=dhtmlmodal.open("agreebox", "iframe", "modalfiles/agreement.htm", "This Page's Terms of service", "width=590px,height=100%,center=1,resize=1,scrolling=0", "recal")

agreewin.setSize(700, dhtmlmodal.docheightcomplete-50)

50 is just an estimate of the chrome's height.