Javascript Questions

A forum for, well, anything really.
Gripes, moans, ideas or just general chit chat. EXCEPT SPAM!!! - Don't just register to post here - IT WILL GET DELETED!!!
Post Reply
User avatar
SkyFlyer
Super Advanced
Super Advanced
Posts: 68
Joined: Tue Jul 29, 2003 4:16 am
Location: Vancouver, Wa
Contact:

Javascript Questions

Post by SkyFlyer »

Hello all! :D
I am less than a beginner with JS! 8O
I know enough about it to do the Menu and such.
I use ThumbsPlus to generate Thumbnails and .htm code for the pictures on my web page. I have selected the create Javascript button in ThumbsPlus to produce that code.
That part works fine. The code and thumbnails work fine.
I would like to be able to click additional thumbnails and open additional pictures without replacing the opened picture window.
Could someone work with me offline (or online) and give me some thoughts on how to do this.
Here is the code that is generated for each thumbnail ...

Code: Select all

td valign="middle" align="center" width="16%"><a href="javascript:;" onClick="w = window.open('P2193900.jpg','TpWebWizImage','width=483,height=600,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no'); w.resizeTo(530,677); w.focus()" style="cursor:hand">
			<img src="tn_P2193900_jpg.jpg" border="0" width="81" height="100" alt="P2193900.jpg"></a></td>
I have some code from Xara that opens new windows, but the code is a little too complex for me to understand how it works.
I can post that code is someone wnats to compare.
Any suggestions would be appreciated ... 8)
Nuffsaid ...
Bob
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Are you saying you want each to open a new window and keep the other windows that are already open, so they can compare and contrast things? If that's what you mean then I think each window will need it's own name.

Ruth
User avatar
SkyFlyer
Super Advanced
Super Advanced
Posts: 68
Joined: Tue Jul 29, 2003 4:16 am
Location: Vancouver, Wa
Contact:

Post by SkyFlyer »

That is what I am saying.
I've been doing some exploring in some books and the net.
Looks like I might need to do some document.write/close and focus for each thumbnail.
Not sure yet ...
Nuffsaid ...
Bob
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Code: Select all

"><a href="javascript:;" onClick="w = window.open('P2193900.jpg','TpWebWizImage','width=483,height=600,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no'); w.resizeTo(530,677); w.focus()" style="cursor:hand"> 



I'm a novice, also, but it seems the window name is TpWebWizImage, so
try putting a number after the TpWebWizImage in each. For example, you'd have TpWebWizImage1 and in the next one TpWebWizImage2 and so on, that seems to open a different new window when you click.

Just as information, what size are you having it resizeTo? Because it goes off the bottom of my screen. I've got resolution set to 800x600, and since it's not resizable, I get a screen with the bottom not available.

Ruth
User avatar
SkyFlyer
Super Advanced
Super Advanced
Posts: 68
Joined: Tue Jul 29, 2003 4:16 am
Location: Vancouver, Wa
Contact:

Post by SkyFlyer »

I'll try the sequential number thing.
I'm not sure about the resizing thing. I just used that as a sample.
In real life, it opens the picture right.
I just added sequential numbers and it did not work.
Thanks for the suggestion.
Nuffsaid ...
Bob
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hmm, it's working here in both IE5.5 and Netscape 7.1 This is what I have on the page.

Code: Select all

<TABLE BORDER="0" CELLPADDING="2">
  <TR>
    <TD valign="middle" align="center" width="16%"><A onClick="w = window.open('P2193900.jpg','TpWebWizImage0','width=483,height=600,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no'); w.resizeTo(530,677); w.focus()"
	  style="cursor:hand" HREF="javascript;">
      <IMG border="0" width="81" height="100" alt="P2193900.jpg" SRC="tn_P2193900_jpg.jpg"></A></TD>
     <TD valign="middle" align="center" width="16%"><A onClick="w = window.open('P2193901.jpg','TpWebWizImage1','width=483,height=600,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no'); w.resizeTo(530,580); w.focus()"
	  style="cursor:hand" HREF="javascript;">
      <IMG border="0" width="81" height="100" alt="P2193900.jpg" SRC="tn_P2193901_jpg.jpg"></A></TD>
	<TD valign="middle" align="center" width="16%"><A onClick="w = window.open('P2193900.jpg','TpWebWizImage2','width=483,height=600,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no'); w.resizeTo(530,677); w.focus()"
	  style="cursor:hand" HREF="javascript;">
      <IMG border="0" width="81" height="100" alt="P2193900.jpg" SRC="tn_P2193900_jpg.jpg"></A></TD>
  </TR>
</TABLE>
Netscape gives me a could not be found, but it opens a new window for each with the page not found in it, Firefox and IE do the same. Opera gives me the could not be found but doesn't open any window.

As to the size, in the code ther is w.resizeTo(530,677) so I have my resolution set at 800x600, that means that the 677 is longer than my actual computer screen because of the resolution.

Ruth
User avatar
SkyFlyer
Super Advanced
Super Advanced
Posts: 68
Joined: Tue Jul 29, 2003 4:16 am
Location: Vancouver, Wa
Contact:

Post by SkyFlyer »

Thanks.
I'll give it another try later.
I'll compare your code to mine.
I have to go for now.
Thanks again ...
Nuffsaid ...
Bob
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Here's a code I use on my site for the borders page with a set of links each one opened a new window. Maybe you can compare this with the code that program generates.

Code: Select all

<A href="#" onClick="window.open ('http://www.poems2u.com/borders/victorianflavor/victorian006.htm','javascript_vic6','location,menubar,resizable=yes'); return false;"><IMG
	    ALIGN="Middle" WIDTH="334" HEIGHT="132" SRC="vic_small006.gif"></A>
If you want to test the page and see if they work for you, here's the link http://www.poems2u.com/borders/victoria ... orian6.htm

Ruth
Post Reply