473,748 Members | 7,571 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Erasing border and padding in javascript window

Eva
Hi,

I'm really really really new to javascripts and so i couldn't really
comprehend thoroughly on the the previous posts regarding this issue.

Anyways, I'm setting up a picture album site. When i click on a
thumbnail or a picture, a larger picture pops up in a javascript
window. But it has a space on the top and on the left of my larger pic
in the pop-up window. How do i get rid of that? Also, i want the
window to fit my my pic so there's no space whatsoever around it.

Here is what i have:

<table height="333" border="0" align="center" cellspacing="0" >
<tr valign="bottom" >
<td align="center"> <SCRIPT language="JavaS cript">
<!--
function my_win()
{
window.open('pi cturealbum/MattMe%20Thumbn ails/images/MattMe1_jpg.jpg ','mywindow','w idth=306,height =257,border=0,p adding=0');
}
//-->
</SCRIPT> <A HREF="javascrip t:my_win()"><IM G
SRC="picturealb um/MattMe%20Thumbn ails/thumbnails/MattMe1_jpg.jpg "
border="0"></A></td>
<td align="center"> <a
href="pictureal bum/MattMe%20Thumbn ails/images/MattMe10_jpg.jp g"><img
src="picturealb um/MattMe%20Thumbn ails/thumbnails/MattMe10_jpg.jp g"
border="0"></a>
</td>
Jul 23 '05 #1
19 4616
On 17 Nov 2004 00:23:38 -0800, Eva wrote:
When i click on a
thumbnail or a picture, a larger picture pops up in a javascript
window. But it has a space on the top and on the left of my larger pic
in the pop-up window. How do i get rid of that?


CSS. (JS is not needed for this one)

--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.LensEscapes.com/ Images that escape the mundane
Jul 23 '05 #2
Thanks. But what do insert and where in my coding do i insert it?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 23 '05 #3
On Wed, 17 Nov 2004 08:35:53 GMT, Andrew Thompson <Se********@www .invalid>
wrote:
On 17 Nov 2004 00:23:38 -0800, Eva wrote:
[...] it has a space on the top and on the left of my larger pic in the
pop-up window. How do i get rid of that?


CSS. (JS is not needed for this one)


I don't think that's feasible here. In the OP, the contents of the new
window is an image by itself. CSS would have no application here.

I'm not sure if there is a solution. If a browser decides to pad the
viewport when displaying an image, I doubt you can persuade it otherwise.

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #4
On 17 Nov 2004 08:45:45 GMT, Eva Lean wrote:

(no norder in image page)

(A.T.)
CSS. (JS is not needed for this one)
Thanks. But what do insert and where in my coding do i insert it?


(Please quote a little of what you are replying to, Eva, to
give it a context. Copy/paste if necessary.)

1st, the best group for advice on CSS is not one that discusses JS.

You are currently posting to
<http://groups.google.c om/groups?as_ugrou p=comp.lang.jav ascript>
...whereas those CSS answers are found on..
<http://groups.google.c om/groups?as_ugrou p=comp.infosyst ems.www.authori ng.stylesheets>

Do a search on the latter group and read some of the posts.
If that does not sort the problem, make a post.

HTH

--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.LensEscapes.com/ Images that escape the mundane
Jul 23 '05 #5
On Wed, 17 Nov 2004 09:20:34 GMT, Michael Winter wrote:
On Wed, 17 Nov 2004 08:35:53 GMT, Andrew Thompson <Se********@www .invalid>
wrote:
On 17 Nov 2004 00:23:38 -0800, Eva wrote:
[...] it has a space on the top and on the left of my larger pic in the
pop-up window. How do i get rid of that?


CSS. (JS is not needed for this one)


I don't think that's feasible here. In the OP, the contents of the new
window is an image by itself. CSS would have no application here.


Oops! My bad. I glanced at the original post and saw HTML
tables and stuff and jumped to the wrong conclusion that it
was the image page.

OTOH, instead of 'showing a raw image' in a window, the OP
could 'show the image page' in the new window, and give it
the image path/name as a parameter in the URL.

(Which would then bring us back to CSS as the solution)

--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.LensEscapes.com/ Images that escape the mundane
Jul 23 '05 #6
On Wed, 17 Nov 2004 09:53:51 GMT, Andrew Thompson <Se********@www .invalid>
wrote:

[snip]
OTOH, instead of 'showing a raw image' in a window, the OP
could 'show the image page' in the new window, and give it
the image path/name as a parameter in the URL.


You could.

You could also not use a new window, avoiding the problem entirely. :)

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #7
On Wed, 17 Nov 2004 10:01:01 GMT, Michael Winter wrote:
You could also not use a new window, avoiding the problem entirely. :)


...best suggestion that has come up in this thread so far.

It will also save the site owners money in support
'I just installed [IE SP2, Google Toolbar..] now your site is
broken! I clicked a link and nothing happened.. '

--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.LensEscapes.com/ Images that escape the mundane
Jul 23 '05 #8
Andrew Thompson <Se********@www .invalid> wrote in message news:<1u******* *************** ********@40tude .net>...
On Wed, 17 Nov 2004 10:01:01 GMT, Michael Winter wrote:
You could also not use a new window, avoiding the problem entirely. :)


..best suggestion that has come up in this thread so far.

It will also save the site owners money in support
'I just installed [IE SP2, Google Toolbar..] now your site is
broken! I clicked a link and nothing happened.. '


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

<html>
<head>
<title>foo</title>
<base href="http://www.maineviews. com/albums/album11/" />
<style type="text/css">

img {
display: block;
margin: 12px;
border: none;
}

</style>
<script type="text/javascript">

var picwin = null;
var filepath = 'http://www.maineviews. com/albums/album11/';
var sHTML = '';

function getHTML()
{
return sHTML;
}

function pw(src, w, h, title, BG)
{
if (null != picwin && !picwin.closed)
picwin.close();
src = (filepath || '').concat(src) ;
var l = (screen.availWi dth - w - 10) * .5;
var t = (screen.availHe ight - h) * .5;
var config = 'width=' + w + ',height=' + h + ',left=' + l + ',top=' +
t + ',status=0';
title = title || 'Picture Window'
BG = BG || '#000';
sHTML = '';
sHTML += '<html><head><t itle>' + title + '</title></head>' +
'<body style="margin:0 ;background:'+B G+';' +
' onblur="setTime out(function(){ self.focus()},2 00)"' +
' onclick="self.c lose()"><img style="border-width:0;cursor: pointer;"'
+
' title="click to close" src="' + src + '"></a></body></html>';

picwin = open('javascrip t:opener.getHTM L()', 'picwin', config);
if (null != picwin && !picwin.closed)
picwin.focus();
return false;
}

</script>
</head>
<body>
<a href="#null" onclick="return pw('sugarshaker s.sized.jpg', 640, 424,
'Sugar Shakers')">
<img src="sugarshake rs.thumb.jpg" />
</a>
<a href="#null" onclick="return pw('threeviews. sized.jpg', 640, 154,
'Three Views')">
<img src="threeviews .thumb.jpg" />
</a>
<a href="#null" onclick="return pw('simplefruit _finished.sized .jpg',
640, 459, 'Simple Fruit')">
<img src="simplefrui t_finished.thum b.jpg" />
</a>
</body>
</html>
Jul 23 '05 #9
Andrew Thompson <Se********@www .invalid> wrote in message news:<1u******* *************** ********@40tude .net>...
On Wed, 17 Nov 2004 10:01:01 GMT, Michael Winter wrote:
You could also not use a new window, avoiding the problem entirely. :)


..best suggestion that has come up in this thread so far.

It will also save the site owners money in support
'I just installed [IE SP2, Google Toolbar..] now your site is
broken! I clicked a link and nothing happened.. '


Oops. Sorry, typo...

sHTML += '<html><head><t itle>' + title + '</title></head>' +
'<body style="margin:0 ;background:'+B G+';"' +
' onblur="setTime out(\'self.focu s()\',100)"' +
' onclick="self.c lose()"><img style="border-width:0;cursor: pointer;"' +
' title="click to close" src="' + src + '"></a></body></html>';
Jul 23 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
4360
by: David | last post by:
Hi, I use the following code to open a javascript window. Is it possible to modify this to have the standard toolbar open in the window? Thanks <script language="JavaScript" type="text/javascript"> function popup() {
5
3393
by: Mark | last post by:
Hi all, how do I open a javascript window from a code behind page? I was using Response.Write("<script language='javascript'>window.open('url','name','options');</script>") but now for some reason it is not working.. Thanks in advance Mark
1
44065
by: bbcrock | last post by:
Is it possible to send attributes into this function to change the print preferences from Portrait to Landscape with IE 6.0 set as the standard browser? Right now I'm using javascript:window.print() as the command. Clients want it and I want to confirm it's not possible. If I'm using an old, deprecated process, please give me a heads-up. I'm no
1
7588
by: DaniltonW | last post by:
I am trying to create a code for add a page to the favorite but "AddFavorite" not appears in the following function: javascript: window. external. AddFavorite? In javascript:window.external. does not appear more options. The page is an aspx.
5
12906
by: zzapper | last post by:
Hi, I use a JavaScript window to access a library of songs when the user picks one this is written to the users database record (PHP/MySQL). When the use closes the JavaScript window he returns to the original browser window. Unfortunately unless he manually refreshes this window he cannot see that he has succeeded in selecting a song. Any ideas how I can force the refresh from the Javascript window, or any other work-around?
2
1651
by: abhilash12 | last post by:
pls help me when mouse move on the cell how can identify cell border using javascript
3
2612
by: =?Utf-8?B?Sm9obg==?= | last post by:
Hi, I have the following in my asp .net web page. It opens a separate browser window. However, on the main page, all of the contents is gone and shows nothing but . I have to use the Back button to get the main page back. How can I open a separate browser window and keep all the contents on the main page? Thanks.
1
2319
gchq
by: gchq | last post by:
Hi there I have a Table nested in a Div that in turn is nested in panel (with scrollbars) in turn nested in a multiview.. The table has the class set as 'print' - that points to a css file via the link <link href="../../../../Styles/Print.css" rel="stylesheet" type="text/css" media="print" /> The CSS being quite simple -
5
2612
by: gvamohan | last post by:
hai every one iam opening an window through javascript <script type="text/javascript" language="javascript"> var k=false; window.open("main.aspx","","status=no,fullscreen=yes"); window.resizeTo(1,1) k=true; window.onresize = function()
0
9544
Oralloy
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9372
jinu1996
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9324
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9247
tracyyun
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8243
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6796
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4606
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4874
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2215
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.