Open maximised window (JavaScript)

The following will open a maximised window, with scrollbars, menubar, but no toolbar (only works with links to pages on the same site - ../folder/file.htm or /folder/file.html not http://www.google.com - Access denied error will occur):

function showDocument(sDocURL){
	var newwin = window.open(sDocURL,'newwin','scrollbars=yes,toolbar=no,menubar=yes');
	newwin.window.moveTo(0,0);
	newwin.window.resizeTo(screen.availWidth,screen.availHeight);
	newwin.focus();
	return false;
}

Call function as follows: <a href="../folder/file.htm" onclick="showDocument(this.href); return false">File</a>
Will set focus on page and replace any existing page that was called in the same way.

Comments

Popular posts from this blog

Select box manipulation with jQuery

iTextSharp: Generating a Basic PDF file (ASP.NET/C#)

Popup Window Countdown (JavaScript)