| View previous topic :: View next topic |
| Author |
Message |
jliz2803
Joined: 05 Jun 2006 Posts: 1
|
Posted: Mon Jun 05, 2006 10:15 pm Post subject: Window Content |
|
|
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] |
|
| Back to top |
|
 |
|
|
rse 100+ Club
Joined: 10 Oct 2004 Posts: 115 Location: Leeds, UK
|
Posted: Thu Sep 14, 2006 2:59 pm Post subject: Re: Window Content |
|
|
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: |
| window.open( [sURL] [, sName] [, sFeatures] [, bReplace]) |
example:
| Code: |
| window.open('ViewPic.aspx?Name='+image,'imageWindow',,); |
I hope this helps. |
|
| Back to top |
|
 |
|
Welcome to DEVPPL.com
You are not logged in, which means that you can't post in the forums. Click here to Register
If you are a current member here on DEVPPL, please login below:
|
|
|
|