Web Hosting Talk







View Full Version : Javascript windowopen - need help!


Nuieve
11-30-2003, 04:35 AM
I know this is a shame I'm asking this but few days spent on surfing the net to find a simple code didn't bring any positive results... :angry:

I need a link to open a 300x450 window with a 300x450 image in it. So that the image will fit the window perfectly. No scrolling, resize - nothing, just the image. That's it!

So far the scripts I used made a window where image was moved dozen of pixels down and right - I can't fix it and I don't understand why it's placed so. I need it to fit the window perfectly.

Please tell me what to put in the head and what in the body.

Thanks!

George

epolady
11-30-2003, 05:11 AM
Try placing your image onto an HTML document. Use CSS to remove all margins & padding. Then use your javascript.

I remember seeing a no-margin pop up script. Ah, here it is. It uses PHP though.
http://www.hotscripts.com/Detailed/10723.html

airnine
11-30-2003, 05:32 AM
you can not open a window of image size by simply using open window function

it has to be inside a doc that already has margins set to 0 and marginwidth/heigh set to 0 as well

it looks like this

first doc has code like this

<script language="JavaScript" type="text/JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
<a href="javascript:;" onMouseClick="MM_openBrWindow('displayimage.php?image=image2','someimage','toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=234,height=5 67')">image</a>

secondoc looks like this

<html>
<head>
<title>displayimage.php </title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
</head>
<body bottommargin="0" leftmargin="0" rightmargin="0" topmargin="0" marginheight="0" marginwidth="0">

I trust you would know how to do it from here on

good luck

Airnine

Nuieve
11-30-2003, 02:38 PM
Thanks, it works!

airnine
11-30-2003, 04:02 PM
No problem, I trust we are all glad we could help

good luck in the future

Airnine