473,401 Members | 2,127 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,401 software developers and data experts.

popups and resizing

I am using a popup window to show pictures. Each time the user clicks on
a thumbnail in the mail HTML page, the popup either appears or reloads a
new picture.

Some pictures are portrait, and some are landscape. I build the popup
html dynamically. How can I a) resize the popup window to fit the image,
and b) pop it to the forefront once the new picture is loaded?

Thanks.

--

use munged address above to email me
SpamTrap Do*****@seiner.com

Jul 23 '05 #1
8 1345
ASM


Captain Dondo a ecrit :

I am using a popup window to show pictures. Each time the user clicks on
a thumbnail in the mail HTML page, the popup either appears or reloads a
new picture.

Some pictures are portrait, and some are landscape. I build the popup
html dynamically. How can I a) resize the popup window to fit the image,
and b) pop it to the forefront once the new picture is loaded?


in popup :

<img src="view_1.jpg"

onload="window.resizeTo(this.width+12,this.height+ 12);
window.focus();"

id="myPict" name="myPict"
alt="Photo" title="This is first view - Click to close"
onclick="self.close()">

--
************************************************** *****
Stéphane MORIAUX et son vieux Mac
************************************************** *****
Jul 23 '05 #2
ASM wrote:

Captain Dondo a ecrit :
I am using a popup window to show pictures. Each time the user clicks on
a thumbnail in the mail HTML page, the popup either appears or reloads a
new picture.

Some pictures are portrait, and some are landscape. I build the popup
html dynamically. How can I a) resize the popup window to fit the image,
and b) pop it to the forefront once the new picture is loaded?

in popup :

<img src="view_1.jpg"

onload="window.resizeTo(this.width+12,this.height+ 12);
window.focus();"

id="myPict" name="myPict"
alt="Photo" title="This is first view - Click to close"
onclick="self.close()">


Some browsers allow the user to disable window re-sizing by script.
Also be aware that for some browsers, an image element's width and
height attributes are empty unless you specify a height and width as
attributes in the tag.

--
Rob
Jul 23 '05 #3
ASM


RobG a *crit :

ASM wrote:

in popup :

<img src="view_1.jpg"
onload="window.resizeTo(this.width+12,this.height+ 12);
window.focus();">
Some browsers allow the user to disable window re-sizing by script.


And same for popups ;-)

And some guys have their JS disabled :-)
Also be aware that for some browsers, an image element's width and
height attributes are empty unless you specify a height and width as
attributes in the tag.


Which ones ?
--
************************************************** *****
Stéphane MORIAUX et son vieux Mac
************************************************** *****
Jul 23 '05 #4
ASM wrote:

RobG a *crit :
ASM wrote:
in popup :

<img src="view_1.jpg"
onload="window.resizeTo(this.width+12,this.height+ 12);
window.focus();">


Some browsers allow the user to disable window re-sizing by script.

And same for popups ;-)

And some guys have their JS disabled :-)

Also be aware that for some browsers, an image element's width and
height attributes are empty unless you specify a height and width as
attributes in the tag.

Which ones ?


From memory, Firefox but testing shows me to be wrong on that count.
Perhaps I was remembering from an old version.

--
Rob
Jul 23 '05 #5
ASM
RobG a ecrit :

ASM wrote:

RobG a ecrit :
ASM wrote:

Also be aware that for some browsers, an image element's width and
height attributes are empty unless you specify a height and width as
attributes in the tag.


Which ones ?


From memory, Firefox but testing shows me to be wrong on that count.
Perhaps I was remembering from an old version.


The only difference I know is that somme browsers consideres
innerWindow and others outerWindow to resize

If popup has its attibutes set on only the title bar
the resizing result is almost same.
(I believe)

--
************************************************** *****
Stéphane MORIAUX et son vieux Mac
************************************************** *****
Jul 23 '05 #6
ASM wrote:


in popup :

<img src="view_1.jpg"

onload="window.resizeTo(this.width+12,this.height+ 12);
window.focus();"

id="myPict" name="myPict"
alt="Photo" title="This is first view - Click to close"
onclick="self.close()">


Thanks, perfect.

Jul 23 '05 #7
RobG <rg***@iinet.net.auau> writes:

[image element's width and height properties empty]
From memory, Firefox but testing shows me to be wrong on that count.
Perhaps I was remembering from an old version.


More likely you remember the first time you tested it. The "width" and
"height" attributes are empty until the image has been loaded. When
the image is in the cache, or on a local drive, or at the end of a
very fast connection, you won't notice it, but you always need to wait
for the image to load before using its width.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 23 '05 #8
ASM
RobG wrote:

Some browsers allow the user to disable window re-sizing by script.
any way most browsers allow to disabled a lot of things :-(

the resising would work ... sometimes
if ... js ennabled ... and ... what you say

Also be aware that for some browsers, an image element's width and
height attributes are empty unless you specify a height and width as
attributes in the tag.


--
Stephane Moriaux et son [moins] vieux Mac
Jul 23 '05 #9

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

Similar topics

3
by: Art | last post by:
NEWBIE ALERT! Esteemed List Participants and Lurkers: (System: P-II 350, 192 meg, Win98 SE, Python 2.2.3, wxPythonWIN32-2.4.1.2-Py22.exe) I'm having a lot of fun getting started with Python...
52
by: Harlan Messinger | last post by:
Can you help me figure out what to do about popups? Sometimes we develop web applications where popups make very good sense for precisely the same reasons they make sense in traditional...
3
by: PSERVE | last post by:
Is the a way of preventing popups from other sites while your page is loading? -- Regards Nik http://www.itconsultancy.org
2
by: Tom Szabo | last post by:
Hi, >>IE in Windows XP Service Pack 2 has a popup blocker that blocks unsolicited >>popups >>IE (other than Windows XP Service Pack 2) also has many add-ons (Google toolbar, >>Yahoo! toolbar,...
4
by: ciprian.dosoftei | last post by:
Hello, I just finished a tutorial website regarding the development of DHTML popups. The site features several examples with downloadable samples. It also feature more complex effects like...
7
by: Nik | last post by:
I'm trying to combine css-popups with an images-in-inline-lists gallery. The problem I see with http://www.niksally.f2s.com/upload/gallery/gallery.html is that the images jog when the mouse...
4
by: dd | last post by:
I have a scenario where my popups are being blocked by IE6+ and Firefox. The problem is that although the popup is a direct result of the user clicking on the link (meaning that they WANT the...
1
by: YotamElal | last post by:
Hello, I have a popup problem. When a popup is opened, I want all other popups to close immediatly. (except for its self and it's child popups) Here is my code: code: <!DOCTYPE HTML PUBLIC...
1
by: Moe Sisko | last post by:
Using : ASP.NET 2.0, IE 7. This is a strange problem with popups not working in IE to remote sites, even though popups are allowed in IE. To reproduce, create web site with two pages,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
0
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...
0
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...
0
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...
0
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,...
0
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...

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.