Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fit Graphic to Window? 1

Status
Not open for further replies.

dRahme

Technical User
Jun 24, 2004
286
US
Hi, I am pretty much a newbie at this stuff and am using NVU to practice with.

My question is, if you set a link to open in a new window, can you size the window to fit the graphic?

A 6" Graphic contained within a 6" window so you don't see the dead space, for example.

Thanks, drahme

 
You cannot set window widths in inches - you can only specify pixels. You would use:

Code:
<a href="imageFilename.jpg" onclick="void(window.open(this.href, '', 'width=600,height=400')); return(false);">Click here</a>

Hope this helps,
Dan

Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Hi, thanks for the help. It works fine.

I don't understand what this:

void(window.open

and this:

return(false);

means. Could you elaborate a bit?

Last question if you have time.

Is there a way to move the window to a particular location,
sort of like docmd.movesize in vba?

Thanks again, drahme
 
"void" simply stops the return value being passed back to the page.

"return (false)" stops the anchor opening the original image (users without JS will still see the image, though).

To move the window to a certain location add "left=n,top=n" to the 3rd paremeter in the open call.

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top