Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > HELP: need to customize the size of the window.open window for different links

Reply
Thread Tools

HELP: need to customize the size of the window.open window for different links

 
 
jdapro
Guest
Posts: n/a
 
      03-21-2005
Hi - thanks for reading this out there! I'll be quick about it:

I've got this row of images (in the end there will be more rows of pics
as well). When a user clicks on the image, I want a new window to open
with a larger version of the image. I want that new window to be
customized to the size of the new larger image. Also, when users go
back to see other images in their larger size, I want the new window
(assuming they never closed the first one) to come back to the front.

I've only gotten as far as getting the larger images to open in a new
window at a set size in the function. I thought I could just make
specific scripts for each image, but that would be cumbersome to say
the least. There has to be an easier way, right?

http://www.geocities.com/jdasf/gordonsmess.html

Let me know.

jdapro

 
Reply With Quote
 
 
 
 
kaeli
Guest
Posts: n/a
 
      03-22-2005
In article < .com>,
enlightened us with...
>
> I've only gotten as far as getting the larger images to open in a new
> window at a set size in the function. I thought I could just make
> specific scripts for each image, but that would be cumbersome to say
> the least. There has to be an easier way, right?


Yes, but it may not be supported.
You can resize the window. However, knowing what size to resize it TO can be
a pain when doing it cross-browser. Different browsers use different syntax
to access the sizes of things like the browser screen. And if there are
scrollbars, toolbars, or whatnot will matter. And browsers can disallow you
from removing those things.
There are a lot of posts in the archives for this group about how to resize
the window to fit the content.

Keep in mind that browsers can disallow resizing altogether, too(mine does).
In fact, my browser (firefox) redirects ALL window.open statements to a new
tab. So if you resize, it resizes everything. Which is very irritating. So I
turned off resizing.

Why do you feel the need to use popups for this content? When you do stuff
like that, tabbed browser users generally can't middle-click and open in a
new tab, which is what we often prefer. You can support both things (new
window for some who like that, new tab for others who prefer that) by
providing a good link, like

<a href="thePic.jpg" onClick="myOpenScript('thePic.jpg');return false;"><img
src="thePic.jpg"></a>

People who just left click will get your open script. Middle-clicking (for us
3-button mouse users) will follow the href. And it supports right-clicking
for MSIE. From my testing, at least, onClick only seems to fire on LEFT
clicks.


--
--
~kaeli~
Cthulhu Saves. He might get hungry later.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

 
Reply With Quote
 
 
 
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
File#size and File#size? follow links? John Joyce Ruby 2 04-27-2007 03:10 PM
mega pixels, file size, image size, and print size - Adobe Evangelists Frank ess Digital Photography 0 11-14-2006 05:08 PM
different memory size in different OS joseph_quanzhou Java 5 10-27-2006 09:29 AM
why size of *this and size of basic and derived class different? Bob C++ 1 10-30-2004 08:33 AM
customize Tkinter window button~ black Python 2 12-04-2003 12:44 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57