HighDots Forums  

Image window

alt.html.dhtml alt.html.dhtml


Discuss Image window in the alt.html.dhtml forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Darrell
 
Posts: n/a

Default Image window - 12-01-2003 , 05:20 PM






I want to have a page that has a lot of thumb nails. I want to be able to
click on a thumb nail and have it open in a window but I don't want a new
window opening every time I click a thumb nail unless the first window
closes it self. In other words I don't want a bunch of windows open.
Is this possible?

--
Darrell



Reply With Quote
  #2  
Old   
m
 
Posts: n/a

Default Re: Image window - 12-01-2003 , 05:28 PM






Darrell wrote:

Quote:
I want to have a page that has a lot of thumb nails. I want to be able to
click on a thumb nail and have it open in a window but I don't want a new
window opening every time I click a thumb nail unless the first window
closes it self. In other words I don't want a bunch of windows open.
Is this possible?

Yes. Don't open a new win in the first place.
It causes accessibility problems.
--
Cheers, m -- http://www.mbstevens.com/howtothumb/


Reply With Quote
  #3  
Old   
Vic Sowers
 
Posts: n/a

Default Re: Image window - 12-01-2003 , 05:55 PM




"Darrell" <darrell (AT) machinemaster (DOT) com> wrote

Quote:
I want to have a page that has a lot of thumb nails. I want to be able to
click on a thumb nail and have it open in a window but I don't want a new
window opening every time I click a thumb nail unless the first window
closes it self. In other words I don't want a bunch of windows open.
Is this possible?

--
Darrell


Yes. you will need language like this:
==========================
<script language="JavaScript">
var popup=null;
function closePopUp() {
if (popup && !popup.closed) popup.close();
}
function popUp(url) {
url = String(url.href);
if (popup && !popup.closed) popup.open(url,"_self");
else popup = window.open(url,"_blank",<params>);
}
window.onunload = closePopUp;
</script>

<a onclick="popUp(this); return false;" href="FullImage_1.htm">
<img src="Thumbnail_1.gif">
</a>
<a onclick="popUp(this); return false;" href="FullImage_2.htm">
<img src="Thumbnail_2.gif">
</a>
<etc...>
==========================

<params> may be found (for IE) at:

http://msdn.microsoft.com/workshop/a...ods/open_0.asp




Reply With Quote
  #4  
Old   
Michael Wilcox
 
Posts: n/a

Default Re: Image window - 12-01-2003 , 06:19 PM



Darrell <darrell (AT) machinemaster (DOT) com> wrote:
Quote:
In other words I don't want a bunch of windows open.
Is this possible?
You could start by not opening them in the first place. Just link each
thumbnail to the full-size image and the user will figure out the rest.
--
Michael Wilcox
mjwilco at yahoo dot com
Essential Tools for the Web Developer - http://mikewilcox.t35.com




Reply With Quote
  #5  
Old   
DU
 
Posts: n/a

Default Re: Image window - 12-01-2003 , 08:26 PM



Vic Sowers wrote:
Quote:
"Darrell" <darrell (AT) machinemaster (DOT) com> wrote in message
news:B8Pyb.23243$n56.23205 (AT) newsread1 (DOT) news.pas.earthlink.net...

I want to have a page that has a lot of thumb nails. I want to be able to
click on a thumb nail and have it open in a window but I don't want a new
window opening every time I click a thumb nail unless the first window
closes it self. In other words I don't want a bunch of windows open.
Is this possible?

--
Darrell




Yes. you will need language like this:
==========================
script language="JavaScript"
Type has superseded language and is both backward and
forward-compatible. So,

<script type="text/javascript">

Quote:
var popup=null;
function closePopUp() {
if (popup && !popup.closed) popup.close();
}
function popUp(url) {
url = String(url.href);
if (popup && !popup.closed) popup.open(url,"_self");
else popup = window.open(url,"_blank",<params>);
There are a few issues here.
First off, I wonder why you load an html file into a popup instead of
just the enlarged image.gif. It's faster to load just a .gif instead of
a full document.
Second, ennlarged images usually do not have the same dimensions. So
loading FullImage_2.htm into the dimensions of the popup when
FullImage_1.htm was created and opened will not make sense.
Third, if the popup just lost focus and the user clicks on the thumbnail
link again in the opener, then the popup will be reloaded when just
bringing it in front would be more efficient. To avoid this, you need to
compare the url.href value with a global variable storing the last
loaded enlarged image href value.


Quote:
}
window.onunload = closePopUp;
/script

a onclick="popUp(this); return false;" href="FullImage_1.htm"
img src="Thumbnail_1.gif"
/a
Fourth, if javascript is disabled, the enlarged image won't be loaded in
a popup but rather in the same window. That's fine and acceptable with
me. I just thought the OP would want to open it in a secondary window as
well. If that's the case, then

<a onclick="popUp(this); return false;" href="FullImage_1.htm"
target="EnlargedImagePopup" title="Clicking this thumbnail will bring an
enlarged image in a separate window (requested popup)">
<img src="Thumbnail_1.gif">
</a>

An example of how all this could be:
http://www10.brinkster.com/doctorunc...Thumbnail.html

DU



Reply With Quote
  #6  
Old   
Andrew Murray
 
Posts: n/a

Default Re: Image window - 12-05-2003 , 11:52 PM




"Darrell" <darrell (AT) machinemaster (DOT) com> wrote

Quote:
I want to have a page that has a lot of thumb nails. I want to be able to
click on a thumb nail and have it open in a window but I don't want a new
window opening every time I click a thumb nail unless the first window
closes it self. In other words I don't want a bunch of windows open.
Is this possible?

--
Darrell

Yes, you can have a pop-up window or whatever to display the image, which using
javascript could probably close after a certain time has elapsed - or provide a
"close" link on the open page displaying the image(s).

<a href="#" onclick="window.close();">Close window</a>

the above HTML code will put a link on the page and will close down the open
window.




Reply With Quote
  #7  
Old   
Leif K-Brooks
 
Posts: n/a

Default Re: Image window - 12-05-2003 , 11:58 PM



Andrew Murray wrote:
Quote:
javascript could probably close after a certain time has elapsed - or provide a
"close" link on the open page displaying the image(s).

a href="#" onclick="window.close();">Close window</a

the above HTML code will put a link on the page and will close down the open
window.
Is my "X" button broken?



Reply With Quote
  #8  
Old   
John Bowling
 
Posts: n/a

Default Re: Image window - 01-21-2004 , 01:27 PM




"DU" <drunclear (AT) hotWIPETHISmail (DOT) com> wrote


Quote:
script language="JavaScript"

Type has superseded language and is both backward and
forward-compatible. So,

script type="text/javascript"
Except:
<script type="text/javascript 1.n"> will not work!
So <script language="JavaScript 1.n"> is still required where defining the
minimum level is required.

I even tried 1.0 and it did not did not run the function in either IE 6 or
Mozilla 1.5





---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.560 / Virus Database: 352 - Release Date: 1/8/2004




Reply With Quote
  #9  
Old   
Mark Parnell
 
Posts: n/a

Default Re: Image window - 01-21-2004 , 05:26 PM



On Wed, 21 Jan 2004 11:27:58 -0700, "John Bowling"
<johnlb2002_TAKEOUT_ (AT) cox (DOT) net> declared in
alt.html,alt.html.dhtml,alt.html.tags:
Quote:
script type="text/javascript 1.n"> will not work!
So <script language="JavaScript 1.n"> is still required where defining the
minimum level is required.

And which browsers don't support all versions of JavaScript these days
(if they support it at all, of course)?

--
Mark Parnell
http://www.clarkecomputers.com.au


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.