Javascript: sharpening and new windows

This forum is for actual topics of discussion that do not fit the above categories.
Locked
User avatar
jonmartensen
Joined: Sat Aug 31, 2002 11:50 pm
Location: Gimmickville USA
Org Profile

Javascript: sharpening and new windows

Post by jonmartensen » Thu Oct 09, 2003 8:13 pm

I need a little help from anyone out there with knowledge of Javascript and building web pages.


I am building a web page at the moment and have run into a little speed bump (I can continue on without the fix, but it would be nice) I have a section with thumbnails of photos I have taken. I use Javascript to open a new window sized specifically for the pictures. After the window is open, when you click on a different thumbnail, the new picture will load in the same window. The problem I have is that the new window is now behind the main page window. I know window.focus() can be used to bring the window to the forground, but I do not know how to pass it to the new window :?

Here is the code I am using (with everything but the javascript and link cut out)

Code: Select all

<html>

	<head>
		<SCRIPT LANGUAGE="Javascript">
		<!--
		function openpicturewindow()
		{
			picturewindow = window.open("","picturewindow", "toolbar=no, location=no, copyhistory=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, width=640, height=480, top=0, left=0");
		}

		//-->
		</SCRIPT>
	</head>
	<body>


		<A HREF="picture001.jpg" onClick="openpicturewindow()" TARGET="picturewindow"> <img src="thumbnail001.jpg" width=80 height=80 border="0" hspace=0 vspace=0></A>

	</body>
	</html>
Now how would I pass window.focus() so that when a second/third/etc thumbnail is clicked, the new image is loaded into the window and the window is brought to the foreground.
Image

User avatar
SnhKnives
V.I.E. 5.5
Joined: Wed Mar 26, 2003 12:57 am
Location: Atlanta
Contact:
Org Profile

Post by SnhKnives » Thu Oct 09, 2003 9:10 pm

Ok im just sort of starting off in java, but lets see if this is what it is.

window.open("","picturewindow", "toolbar=no, location=no, copyhistory=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, width=640, height=480, top=0, left=0");

check that. Set it to like "front" other wise you have a few parameters....that are missing........here

window.open ("","picturewindow",


lemme know if that works[/u]
Image

User avatar
jonmartensen
Joined: Sat Aug 31, 2002 11:50 pm
Location: Gimmickville USA
Org Profile

Post by jonmartensen » Thu Oct 09, 2003 10:16 pm

Nevermind, I got it. :D
Image

Locked

Return to “General Off Topic”