473,795 Members | 2,867 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Popup - detect and autosize to image

Hi,
I have a page with a bunch of thumbnails that when clicked, open the full
size image in a new window. They are all different sizes and its a bit
unprofessional looking. I'd like to find a component or script that will
detect the size of the linked image and create a popup correctly sized to
the image. Would have no toolbar, buttons,scrolli ng, etc. Just a clean,
correctly sized window.

Any way to do this?

TIA
Jul 22 '05 #1
2 5491
"Jake" <sp******@allte l.net> wrote in message
news:Os******** ******@TK2MSFTN GP12.phx.gbl...
Hi,
I have a page with a bunch of thumbnails that when clicked, open the full
size image in a new window. They are all different sizes and its a bit
unprofessional looking. I'd like to find a component or script that will
detect the size of the linked image and create a popup correctly sized to
the image. Would have no toolbar, buttons,scrolli ng, etc. Just a clean,
correctly sized window.

Any way to do this?

TIA

Will this help? Watch for word-wrap.

<html>
<head>
<title>enlarge. htm</title>
<script type="text/javascript">
function enlarge(image) {
var i = new Image();
i.src = image;
var x = i.width;
var y = i.height;
// window.status for degugging:
window.status = image + " = " + x + " x " + y + " pixels";
var z = "scrollbars=no, width=" + (x+20) + ",height=" + (y+20);
window.open(ima ge,"image",z);
}
</script>
</head>
<body>
<a
href="javascrip t:enlarge('http ://www.google.com/intl/en/images/logo.gif');"<img src="http://groups-beta.google.com/images/google_sm.gif"

border="1" width="143" height="59" alt="Click to enlarge"></a>
</body>
</html>
Jul 22 '05 #2
first you will need to get the actual size of the image. best time to do
this is when you upload the image (keep info in a database so that you don't
have to extract it every time a page is displayed). If you know the size at
that time use it. otherwise see http://www.aspfaq.com/show.asp?id=2170 for
info about extracting size.

Embed the size in your window.open statement (in the client-side code you
generate) for each thumbnail link.

--
Mark Schupp

"Jake" <sp******@allte l.net> wrote in message
news:Os******** ******@TK2MSFTN GP12.phx.gbl...
Hi,
I have a page with a bunch of thumbnails that when clicked, open the full
size image in a new window. They are all different sizes and its a bit
unprofessional looking. I'd like to find a component or script that will
detect the size of the linked image and create a popup correctly sized to
the image. Would have no toolbar, buttons,scrolli ng, etc. Just a clean,
correctly sized window.

Any way to do this?

TIA

Jul 22 '05 #3

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

Similar topics

2
4382
by: Moon | last post by:
Seems I still haven't got the hang of all those window generating code in Javascript. I've got a page with about 15 photo thumbnails. When you click on a thumbnail a new window pops up which shows the enlarged version of said thumbnail. This works fine on all current browsers I've tested. However, in case I do not close the popup but click on another thumbnail instead, only IE replaces the enlarged pic by the new one, Firebird and Opera...
10
3190
by: Agony.COM | last post by:
Hi there all, Is there a way, using Javascript, that you can detect if a popup window has opened successfully? I'm tring to work out if someone is running popup blocking software or not. Cheers, @ndyB
13
6267
by: ldan | last post by:
Hi everybody, I would not consider myself an expert in javascript - but so far whatever I know, helped me reaching my goals. Recently I started to experience a lot of javascript errors related to opening up a popup window in an application I wrote. The error messages are quite diverse: "Object doesn't support this property or method" or "Unspecified error." or "The callee (server ) is not available and disappeared; all connections are...
6
22395
by: Rich | last post by:
Hello, I am putting together a simple picture viewing program to view jpg. bmp pictures. I have the picturebox sizemode set to autosize. I have the picturebox in a pannel set to autoscroll, so if I get a picture that is larger than the width/height of the containing form (pannel, etc) I can scroll. But some of the pictures are like 5 megapixels and are just way too large for the screen. When I open this pic in Microsoft Photo Editor...
1
11165
by: Al | last post by:
I'm using visual C# 2005 Express Edition and I would like to open the image in the picture box, without make the picture box larger. For the moment, the code is: private void button1_Click(object sender, EventArgs e) { openFileDialog1.ShowDialog(); Image img = Image.FromStream(openFileDialog1.OpenFile()); pictureBox1.Image = img; pictureBox1.SizeMode = PictureBoxSizeMode.AutoSize; //but this only modifies the size of the pictureBox
8
3430
by: Jordi Rico | last post by:
Hi, I've made the next inherited class in Visual Studio 2005: Public Class LabelEx Inherits System.Windows.Forms.Label Sub New() MyBase.New() Me.ForeColor = Color.Black Me.AutoSize = False Me.Height = 16
2
7842
by: Dravid | last post by:
Hello, I am putting together a simple picture viewing program to view jpg pictures. I have the picturebox autosize set to true. I dont have the picturebox in a pannel set to autoscroll, so if I get a picture that is larger than the width/height of the containing form (pannel, etc) I can't able to scroll. When I open this pic in Microsoft Photo Editor - it opens to 50% zoom by default. How can I set the zoom in my picturebox which is...
1
1678
mageswar005
by: mageswar005 | last post by:
hi, how to detect yahoo popup blocker, in my site i open a popup window but some local pc yahoo popup blocker can control my popup window. how can i detect the popup blocker....
4
7183
by: goscottie | last post by:
I used submodal as my popup window. With some tweaks, it working great in my app. However, I can't find a way to detect session timeout in the popup window. The app is a form based authentication so the default.aspx page will show up in the popup. So I'm looking into several options. 1. detect session timeout in javascript so that I prevent the popup from even happening. I can simply redirect or post to itself so that the calling...
0
9673
marktang
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9522
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10448
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...
1
10167
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
9046
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
7544
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
6784
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5440
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
5566
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.