PDA

View Full Version : Pop-up without menus, etc.


goodoyster
06-28-2002, 08:27 PM
I am using a script to open a window with the full size picture when someone clicks the thumbnail. Easy enough, works great. This script I'm using opens a window to fit the dimensions of the image, however, it includes the full complement of browser accessories, i.e. menus, address line, scrollbars, etc. I'd prefer to have it open to the size of the image, with nothing but the title bar. Can I add something to this script that will do this, or do I need to use a totally different script. Here is what's in the head of the pop-up page:

var isNav4, isIE4;
if (parseInt(navigator.appVersion.charAt(0)) >= 4) {
isNav4 = (navigator.appName == "Netscape") ? 1 : 0;
isIE4 = (navigator.appName.indexOf("Microsoft") != -1) ? 1 : 0;
}
function fitWindowSize() {
if (isNav4) {
window.innerWidth = document.layers[0].document.images[0].width;
window.innerHeight = document.layers[0].document.images[0].height;
}
if (isIE4) {
window.resizeTo(600,600);
width = 600 - (document.body.clientWidth - document.images[0].width);
height = 600 - (document.body.clientHeight - document.images[0].height);
window.resizeTo(width, height);
}
}

And the body tag gets the "onload="fitWindowSize()".

Any suggestions would be appreciated.

tamienne
06-28-2002, 08:44 PM
what's the code your using to open the window?

Are you doing a window.open or target="_blank" in the href?

goodoyster
06-28-2002, 08:54 PM
target="_blank"

whackaxe
06-28-2002, 09:01 PM
well if you are using _blank you cant do much i think but with window.open try this

winodw.open("page.html", "pagename", "menubar=0, toolbar=0, statusbar=0, personalbar=0") there are few more but i cant remeber them

ObiwanJebroni
06-28-2002, 09:51 PM
but I'm going to try to learn something while I'm at this forum (since I'm at a standstill with my project, everybody's left, and I'm the only one at the office).

Does the code that you suggest, whackaxe, make like those annoying add pop-up windows that you get and that you can't find the [X] button at the top right of the window?

And where can I find all the properties of all these parts of a webpage? When I read over other people's JavaScript code and such, all these properties just seem to pop out of nowhere. It certainly would be good if there's a reference I could look at with all these properties listed.

whackaxe
06-29-2002, 09:29 AM
no it makes whatever type of window you choose with the different parameters

go down the folder tree in this order in the msdn.microsoft.com/library section and look for open(window) and look at all the different thigs it does

web development > HTML and Dynamic HTML > Reference > Methods