Flash Games
 FAQ   Search   Memberlist   Usergroups   Register  Profile   Log in to check your private messages   Log in 


Window Content



 

Post new topic   Reply to topic  
   DEVPPL Forum Index -> JavaScript Forum
View previous topic :: View next topic  
Author Message
jliz2803



Joined: 05 Jun 2006
Posts: 1

PostPosted: Mon Jun 05, 2006 10:15 pm    Post subject: Window Content Reply with quote

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
View user's profile Send private message
rse
100+ Club


Joined: 10 Oct 2004
Posts: 115
Location: Leeds, UK

PostPosted: Thu Sep 14, 2006 2:59 pm    Post subject: Re: Window Content Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    DEVPPL Forum Index -> JavaScript Forum All times are GMT + 1 Hour
Page 1 of 1

 
 
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:

User: Pass:
Log me on automatically each visit:

 


Powered by phpBB © 2001, 2005 phpBB Group - Modified by DEVPPL

Flash Games - Sitemap