Hello,
I'm buidling a friends-website. I have bunch of pictures. I used the
javascript to open the images in real size in a pop-up.
<script language="JavaScript">
<!--
function nph_open_window(url, name, feature)
{
window.open(url, name, feature);
}
// -->
</script>
And I call it with:
<a href="javascript:nph_open_window('Foto/heid/heid10.jpg', 'heid10',
'width=550,height=400,toolbar=no,menubar=no,status =no,scrollbars=no,resizabl
e=no')"> <img src="Foto/heid/heid10l.jpg" width="102" height="72"
border="0"></a>
BUT when the pop-up opens, I see the LEFT and TOP border/margin. So it
doesn't fit exactly in the pop-up.
Can someone help me to fix it ?
Thanks ! 7 1857
"Joker" <ra***@hotmail.com> wrote in message
news:33***************************@news.multikabel .nl... Hello,
I'm buidling a friends-website. I have bunch of pictures. I used the javascript to open the images in real size in a pop-up.
<script language="JavaScript"> <!-- function nph_open_window(url, name, feature) { window.open(url, name, feature); } // --> </script>
And I call it with: <a href="javascript:nph_open_window('Foto/heid/heid10.jpg', 'heid10',
'width=550,height=400,toolbar=no,menubar=no,status =no,scrollbars=no,resizabl e=no')"> <img src="Foto/heid/heid10l.jpg" width="102" height="72" border="0"></a>
BUT when the pop-up opens, I see the LEFT and TOP border/margin. So it doesn't fit exactly in the pop-up.
Can someone help me to fix it ?
Thanks !
How about the following; watch for word-wrap:
<html>
<head>
<title>open_win.htm</title>
<script type="text/javascript">
function nph_open_window(url,wid,hgt) {
var nam = url.substring(url.lastIndexOf("/")+1,url.length-4);
var cfg = "width="+wid+",height="+hgt+",resizable=no";
var htm = "<html>";
htm += "<body leftmargin='0' topmargin='0'>";
htm += "<img src='" + url +"' border='0' alt=''>";
htm += "</body>";
htm += "</html>";
var win = window.open("",nam,cfg);
win.document.write(htm);
}
</script>
</head>
<body>
<img src="Foto/heid/heid10l.jpg"
border="0" width="102" height="72"
alt="Click to enlarge." style="cursor:hand"
onclick="nph_open_window('Foto/heid/heid10.jpg',550,400)">
</body>
</html>
Since you may have pictures of different sizes, the dimensions are passed to
the finction.
Note that your thumbnail images may be distorted if they're all displayed at
102 x 72.
Also, here's some info on the window.open method: http://www.devguru.com/Technologies/.../win_open.html
McKirahan wrote:
--- snip ---
################################################## ######### htm += "<body leftmargin='0' topmargin='0'>";
################################################## #########
leftmargin and topmargin did never belong to the HTML-standard
as defined by the W3C, better use CSS instead:
html += "<body style='margin: 0'>"
--- snip ---
cu, Michael
On Mon, 5 Jul 2004 18:34:18 +0200, "Joker" <ra***@hotmail.com> wrote: I used the javascript to open the images in real size in a pop-up.
<script language="JavaScript"> <!-- function nph_open_window(url, name, feature) { window.open(url, name, feature); } // --> </script>
And I call it with: <a href="javascript:nph_open_window('Foto/heid/heid10.jpg', 'heid10', 'width=550,height=400,toolbar=no,menubar=no,statu s=no,scrollbars=no,resizabl e=no')"> <img src="Foto/heid/heid10l.jpg" width="102" height="72" border="0"></a>
BUT when the pop-up opens, I see the LEFT and TOP border/margin. So it doesn't fit exactly in the pop-up.
Not clear what you mean by LEFT and TOP. In any event, how big is the
image? Is it 550 x 400? If so, then you have to leave enough room
for margins around the image. 550 x 400 would be the total size of the
window, not counting the borders and title bar.
Myron Turner www.room535.org
Joker wrote: Hello,
I'm buidling a friends-website. I have bunch of pictures. I used the javascript to open the images in real size in a pop-up.
Just in passing - what about browsers (such as all the modern ones) that
can stop pop-ups (and do so by default)?
Thank you very much !!
"Michael Schmitt" <mi****@wel.de> schreef in bericht
news:cc************@news.t-online.com... McKirahan wrote:
--- snip ---
################################################## ######### htm += "<body leftmargin='0' topmargin='0'>"; ################################################## ######### leftmargin and topmargin did never belong to the HTML-standard as defined by the W3C, better use CSS instead: html += "<body style='margin: 0'>"
--- snip ---
cu, Michael
Mark Preston wrote: Joker wrote:
Hello,
I'm buidling a friends-website. I have bunch of pictures. I used the javascript to open the images in real size in a pop-up. Just in passing - what about browsers (such as all the modern ones) that can stop pop-ups (and do so by default)?
My Mozilla is configured to block unrequested popups. But in this case the
popup-window is _not_ unrequested, so it opens as wanted. A different
question would be, what's about people, who have javascript disabled?
cu Michael
Michael Schmitt wrote: McKirahan wrote: htm += "<body leftmargin='0' topmargin='0'>"; ################################################## #########
Please learn how to quote in Usenet.
leftmargin and topmargin did never belong to the HTML-standard as defined by the W3C,
Correct.
better use CSS instead: html += "<body style='margin: 0'>"
The CSS equivalent would be <body style='margin-left:0; margin-top:0'>.
Your code removes the margins on all sides.
PointedEars This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Johannes Götzinger |
last post by:
hello everyone,
I use a script to save .jpg-images in a mysql database. Another small
script outputs the database-stored-image to the browser
(getdbfile?id=1). All works fine.
Now I want to...
|
by: Display Name |
last post by:
When this form's being submitted, two windows are opening instead of only
one
here is the function I'm using:
function subForm(){
//insert form validation here
//if form is valid, open a...
|
by: Richard Hollenbeck |
last post by:
I have pages that I want a particular person to download dozens of images.
Instead of opening each image separately with right-clicks, I want to be
able to have them simply click, and the program...
|
by: sjp |
last post by:
I need to open new windows only for the purpose of viewing linked
images, maybe a dozen or so throughout the site. Using the
Target="blank" command is quick, easy and seems like the best way to...
|
by: Apotheosis |
last post by:
The problem professor gave us is:
Write a program which reads two integer values. If the first is less
than the second, print the message "up". If the second is less than
the first, print the...
|
by: john |
last post by:
Hi,All MS Tech Gurus:
I need your help!!! It is the second time I post this message, I need get
some feedback ASAP, Please Help!!
Thanks a lot in advance.
John
I have a csharp method, using...
|
by: Mark R. Dawson |
last post by:
Hi all,
I have a directory full of images (most over 2MB in size) I was to show
each image as a thumbnail on a form, however in order to create a thumbnail I
have to open the complete image then...
|
by: Gary |
last post by:
Can somebody help me get the onMouseOut to work in this script? The
onMouseOver works great opening a new window with an image, but I'd like to
get the popup window to close onMouseOut. Is this...
|
by: Xah Lee |
last post by:
The following is a program to generate thumbnail images for a website.
Useful, if you want to do that.
It is used to generate the thumbnails for my “Banners, Damsels, and
Mores” project...
|
by: geetamadhavi |
last post by:
Hi All,
I have developed a php applciaiton where a new window is opening on checking the whether valid user orntot how to make that in same window after checking i have die(' not valid user ' ); i...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |