It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming JavaScript Forum

Window Content

Window Content

Postby jliz2803 on Mon Jun 05, 2006 9:15 pm

I have a page where a user clicks an image and a window pops up with an enlarged version of that image. The problem I am hving is that if the user clicks multiple images then multiple windows pop up. How can I make it so that for each time an image is clicked, instead of a new window popping up everytime, the content is just changed if the window is already open, and pops up if the window is not open. Here is the code I am currently using
[code]
var pic = window.open('ViewPic.aspx?Name='+image);
pic.moveTo(0,0);
pic.resizeTo( 650, 650 );
[/code]
jliz2803
 
Posts: 0
Joined: Mon Jun 05, 2006 9:11 pm

Postby rse on Thu Sep 14, 2006 1:59 pm

I'm not a JS expert but maybe you could add the sName attribute to your window.open, that way the image should be replaced if a window with that name is already open. See http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/open_0.asp .

syntax:
Code: Select all
window.open( [sURL] [, sName] [, sFeatures] [, bReplace])


example:
Code: Select all
window.open('ViewPic.aspx?Name='+image,'imageWindow',,);


I hope this helps.
Adam Williams
PHP Web Developer

Personal: http://30things.net
Blog: http://www.root-servers.co.uk
User avatar
rse
100+ Club
 
Posts: 141
Joined: Sun Oct 10, 2004 8:15 pm
Location: Leeds, UK


Who is online

Users browsing this forum: Yahoo [Bot] and 6 guests