Images open in new window same size as image only


I've a page on my website that contains thumbnails of images and when clicked on a new browser window opens with the image showing at full size (whatever that size may be). What I'm trying to do though is get the new window to open up only to the size of the image and no bigger, along with a 'Close' label on the new window. Can any one please help?


Many thanks,


4/14/2006 8:13:27 AM 91979 articles. 4 followers. Follow

2 Replies

Similar Articles

[PageSpeed] 49
Get it on Google Play
Get it on Apple App Store

Doesn't really have much, if anything, to do with ASP.NET, this has to be accomplished with javascript

here's a function that can do what you ask:

function resizeWindow() {
     var iWidth = document.images['img1'].width + 20;
     var iHeight = document.images['img1'].height + 170;

Few things:
1) you'll gave to load the image into an image tag with the id/name of "img1" (or change the function)
2) play around with the "20" and/or "170" to how you want it
3) put:   onLoad="resizeWindow();"        in the <body> tag

Hope that helps

"If you make it idiot proof, they'll build a better idiot"
4/14/2006 9:43:45 AM

Brilliant - many thanks for the advice.



4/14/2006 10:16:12 AM

Similar Artilces:

Get Image Size from New Image
Hi:I have an application where I have a dropdown box and it fires an event to load a new image from my  SQL Server 2005 database.  I am able to show the image but would like to show the dimensions as a label but not able to do this. My code looks like this//This works fine - can load the image imgLargePic.ImageUrl = "~/Controls/Fetch_Pic.ashx?ProductPicID=" + iProductPicID + "&Size=Large";//Can't get this to work... - next line of code...lblPicSize.Text=imgLargePic.Width.Value.ToString() + "X" + imgLargePic.Height.ToString();  ...

Opening window with size of image with javascript function
  Is it possible in suppose a page is having the image control.--->showImage.aspx after clicking on the "View" button control on first page (with button.attributes.add("showImage.aspx")) showImage.aspx page opens, i want that .size of the image should be the size of the window(means window should accomodate image accurately). Plz help me with the help of example or any url;   is this what you want ?  regards,Niraj sikotara. regards,Niraj sikotara.<!-- Search before you scram...

How to open up a new window with current image in Image button control
I have an image button control  that reads an image for a directory .How do i make it open up a new window with the same image as in the button control. I know you use PostBackUrl to open up the window but nothing appears. The image  name changes and has the name Image(dynamic number).jpg Check below link Passing Data between Parent and child window Hope this helpsHaissam Abdul MalakMCAD.NET| Blog | See my sample below:JAVASCRIPT<script type="text/javascript" language="javascript">    function DisplayNewImageInWidnow()   &n...

opening a new window and resizing to image size
i have a results page on my site here the link is a basic link and simply goes to the page indicated i want to open a new window and i build better guitars than i do websites so where do i put the javacript to open a new window? I also want it to resize automatically to the image size. basicall can someone show me what i need and where it needs to be?  There are quite a few implementations:Google search: "resize window to image"  -- "Mark As Answer" if my reply helped you -- I did that and the problem i think...

getting remote image sizes with image::size lwp
I am trying to get the width and height attributes of jpg's and gif's on a remote server. I have found Image::Size and LWP but am unable to put them together so that I can open an http path (e.g. and print out the image size. Any help would be appreciated including where I might go to read more on this. TIA My first attempt that failed: #!/usr/bin/perl # The next few lines use the LWP (Library www perl) module # to read the files via http that each url points to. $the_url =3D '

image links opened in new windows dont expand to show full image
Name: mike Product: Firefox Summary: image links opened in new windows dont expand to show full image Comments: when i click on a thumbnail-like image link that opens the full picture in a new window, the window doesnt expand to show the full image, this did not happen in Firefox 2 From URL: ...

getting remote image size with Image::Size & LWP
=19 Thank you for your patience and help bringing me up to speed on how to be a better user of this list. My previous post was my first. I am trying to write a script that will use Image::Size module in conjunction with the LWP module to retrieve the height and width attribute of a gif or jpg on a remote server. Below the first script uses the Image::Size module and successfully returns the height and width of an image on the same volume. The second script uses the LWP module and depending on which version of $the_url is used, successfully returns the contents of an html file or an ...

Getting image size without loading the image
Hi, is there anywhere an interface to get the image size from a file without loading the whole image? When I want to display a catalog of images in a directory, I also want to display the size of each image, but do not like to load the images. I just want to get the size as fast as possible. Is there an interface available for this purpose? Georg Georg Maa� wrote: > is there anywhere an interface to get the image size from a file without > loading the whole image? That must be a popular thing to do, someone else also asked for that recently. You can use img...

How do I open an image in a new window?
Hi All, I want to have links on my aspx page that when clicked open up images in a new browser window. I want to be able to set the size of the new window. I can achieve this easily with a standard html page etc but how do I do it from within an aspx page? Any code samples or snippets would be a great help! Many Thanks!Malc Its the same you do with html pages. <a href="" onclick="'images/image1.jpg');">Link1</a> ThanksMark post(s) as "Answer" that helped youElectronic ScrewWebsite||Blog||Dub...

Problem making image
I have a Dell Latitude 131L that I am trying to make an image of, but it seems that imaging engine somehow cant find the partition with the OS, so I only get an image with 4k size. Anyone have any ideas to what might cause it, and posible solutions? On Fri, 27 Apr 2007 10:44:28 GMT, Thor wrote: > Anyone have any ideas to what might cause it, and posible solutions? it can't find the hd, which patchlevel are you running? -- If you have already compiled drivers or have linux.2 please put them on Live BootCd and...

Image on Image
I am trying to display a page that has image of a map on it. The user can then place other images of red thumbtacks on the image at different locations. Then when these thumb tacks are clicked on, they open a folder of pics related to the area. I saw a method in the imageButton class that returns the (x,y) of the location where the user clicked. I thought I could use this information to place another, smaller image button, on that area. My problem is that i can't seem to get the bottom imageButton to be transparent so I can see the smaller one. Am i on the right track with this. Any advi...

image and image
// create an image object, using the filename we just retrieved System.Drawing.Image image = System.Drawing.Image.FromFile(Server.MapPath(file)); // create the actual thumbnail imageSystem.Drawing.Image thumbnailImage = image.GetThumbnailImage(64, 64, new System.Drawing.Image.GetThumbnailImageAbort(ThumbnailCallback), IntPtr.Zero);   now my question is how to display this image in my image1 control in (version 1.1) the below line of code is not working.  Image1.ImageUrl=thumbnailImage.ToString();Mark As Answer If my reply helped you. Hi, you can save t...

Image in image
Hi, I have a project where clients viewing my website can buy t-shirts. They can choose from a number of t-shirt colors and shapes which are their plain colour. They can also choose a number of prints to be placed on the t-shirt. These will be graphics stored in a database. My problem is on how I can displaty the t-shirt with the graphics or logo they chose on te t-shirt. It would be something like drawing text on an image but instead drawing an existing image on the base image. Any Ideas? (I am using visual studio 2005 and vb.NET)   RegardsMerovingian you 1. You can create a...

Imaging, but not imaging
We multicasted to 43 machines. Updated the image on the master. Multicasted the updated image to 36 machines. (the other 7 wouldn't join the session for some unknown reason). I visually verified that all 36 were imaging. One of the 8 which didn't rename appears to not even have been imaged. The problems with the previous image were still there. It's as though the machine didn't image even though I saw it take part in the session and the temp bar going across the screen. What the heck's going on here? AlaN As a try, what happens if you boot either to PXE ...

Web resources about - Images open in new window same size as image only -

Twist Image
At Twist Image, we connect brands to people and people to brands. Let us show you what we mean.

Wikipedia:WikiProject Images and Media/Photography - Wikipedia, the free encyclopedia
This WikiProject 's primary aim is to encourage the contribution and improvement of photographs on Wikipedia. The project seeks to act as a focal ...

Image compares Saudi Arabia with Islamic State as execution protests grow
Iranian protesters set fire to the Saudi embassy in Tehran after the execution of an outspoken Shiite cleric. But it was a picture posted on ...

Police release images of a second Christmas "Grinch" after Baldivis present grab
Kwinana police are seeking help in tracking down another present-snaffling Christmas Grinch.

Malcolm Turnbull condemns leaking of image of public servant in Jamie Briggs scandal
Prime Minister Malcolm Turnbull slams the leaking of an image of a female diplomat caught up in the Jamie Briggs scandal.

Graphic Grades: How to Give Your Company Image an Update
All brands need a facelift from time to time, and while some updates are minor, others can be more extensive. As a business looking to modernize ...

Ars’ favorite science images of 2015
... it's one thing to hear a description of the developing brain, and another thing entirely to see one as it's developing. In some cases, images ...

This New Year's Eve, make sure your PC is safely backed up with our O&O Disk Image 9 Downloadcrew Giveaway ...
... backup this New Year’s Eve? That’s right, today, December 31 we’re providing you with a 24-hour giveaway of the brilliant O&O DiskImage 9 Professional ...

Uncompromising Cruz Embraces “Abrasive” Image
Ted Cruz's reputation as an arrogant, grating, in-your-face ideologue has dogged him throughout the Republican presidential race. But it hasn't ...

This is what the entire universe looks like in one image
... one field of view. But musician Pablo Carlos Budassi managed to do it by combining logarithmic maps of the universe from Princeton and images ...

Resources last updated: 1/4/2016 5:08:09 PM