Click to See Complete Forum and Search --> : Image improperly centered in pop-up window


Exterminance
11-22-2003, 09:04 AM
I attempted to make a pop-up window which contains only a hyperlinked graphic, using this form (http://javascript.internet.com/generators/popup-window.html). Everything went fine except: I specified the window to the exact size dimensions of the image file, but there seems to be some sort of border area around the image file, and I can't figure out how to make it go away. Any body know what I need to do?

My pop-up page: advertisement.html (http://members.odinsrage.com/exterminance/advertisement.html).

The HTML used:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title>Pop-Up Test</title><SCRIPT LANGUAGE="JavaScript"><!-- Begin
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=340,height=359,left = 630,top = 420.5');");
}
// End -->
</script></head><body>
<A HREF="javascript:popUp('ultimatepopupyo.html')"><img src="FLASHbanner.gif"></A>
<!-- Script Size: 0.73 KB --></body></html>

My pop-up itself: ultimatepopupyo.html (http://members.odinsrage.com/exterminance/ultimatepopupyo.html).

The HTML used:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title>WINNER!?!</title><SCRIPT LANGUAGE="JavaScript"><!-- Begin
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=340,height=359,left = 630,top = 420.5');");
}
// End -->
</script></head><body>
<A HREF="javascript:popUp('ultimatepopupyo.html')"><img src="ultimatepopupyo.gif"></A>
<!-- Script Size: 0.73 KB --></body></html>

Any advice would be greatly appreciated!

Paul Jr
11-22-2003, 10:47 AM
If my memory serves me, just add border="0" in your <img> tag.


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<html><head><title>WINNER!?!</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<script type="text/javascript">
<!-- Begin
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=340,height=359,left = 630,top = 420.5');");
}
// End -->
</script>
</head>

<body>
<a href="javascriptopUp('ultimatepopupyo.html')"><img src="ultimatepopupyo.gif" width="340" height="359" border="0" alt="You May Be A Winner!!!"></a>
</body>
</html>

Jish
11-22-2003, 02:22 PM
Try adding


<style type="text/css">

body {
margin: 0px; }

</style>


To the page containing the popup.

Exterminance
11-22-2003, 08:13 PM
Originally posted by Jish
Try adding


<style type="text/css">

body {
margin: 0px; }

</style>


To the page containing the popup.

I want to try this, but I'm very unfamiliar with Java, so I'm not sure where to plant this snippet in the existing code!

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title>WINNER!?!</title><SCRIPT LANGUAGE="JavaScript"><!-- Begin
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,men
ubar=0,resizable=0,width=340,height=359,left = 630,top = 420.5');");
}
// End -->
</script></head><body>
<A HREF="javascriptopUp('ultimatepopupyo.html')"><img src="ultimatepopupyo.gif"></A>
<!-- Script Size: 0.73 KB --></body></html>

+

<style type="text/css">

body {
margin: 0px; }

</style>

=

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title>WINNER!?!</title><SCRIPT LANGUAGE="JavaScript"><!-- Begin
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,men
ubar=0,resizable=0,width=340,height=359,left = 630,top = 420.5');");
}
// End --><style type="text/css">

body {
margin: 0px; }

</style></script></head><body>
<A HREF="javascriptopUp('ultimatepopupyo.html')"><img src="ultimatepopupyo.gif"></A>
<!-- Script Size: 0.73 KB --></body></html>
http://forums.webdeveloper.com/images/icons/icon5.gif

Exterminance
11-23-2003, 08:52 PM
Nope, it ain't working. If the snippet of code is right, I've planted it in the wrong area...

(I created two new pages in case something went awry, so I still have the first two operational... advertisement2.html (http://members.odinsrage.com/exterminance/advertisement2.html) and ultimatepopupyo2.html (http://members.odinsrage.com/exterminance/ultimatepopupyo2.html))

Paul Jr
11-23-2003, 09:23 PM
It would like something like...


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<html><head><title>WINNER!?!</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<style type="text/css">
body {
margin: 0;
padding: 0;
}
</style>

<script type="text/javascript">
<!-- Begin
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,men
ubar=0,resizable=0,width=340,height=359,left = 630,top = 420.5');");
}
// End -->
</script>
</head>

<body>
<a href="javascriptopUp('ultimatepopupyo.html')"><img src="ultimatepopupyo.gif" width="340" height="359" border="0" alt="You May Be A Winner!!!"></a>
</body>
</html>