Jump to content

Image popup that closes when next pic is clicked


mikemessiah

Recommended Posts

Basically I have this:

 

<a onclick="window.open(this.href,'Name','resizable=no,width=265,height=210'); return false;" href="<?php echo "mini2.php?id=$ID" ?>">

            <?php 	if( $Photo2 == '' ) {echo "<img class=\"img-border1\" src=\"/images/no-pic.jpg\" width=\"60px\" height=\"45px\">";}
		else echo " <img class=\"img-border1\" src=\"mini2.php?id=$ID\" width=\"60px\" height=\"45px\"> "?>
</a>

 

Looks a little confusing I know I lack of coding skills is showing once again.

 

It works... The only problem is that the people are clicking on another pic and it is opening in the same window and dissapearing behind the main window.

 

Is there a way to make it pop up and close again or at least be brought to front when a second link is clicked?

 

I dont think we can use this normal std javascript pop up

 

<HTML>
<HEAD>
   <TITLE>The Image Gallery</TITLE>
   <script language="Javascript">
   function PopupPic(sPicURL) {
     window.open( "popup.htm?"+sPicURL, "",  
     "resizable=1,HEIGHT=200,WIDTH=200");
   }
   </script>
</HEAD>
<BODY bgcolor="#FFFFFF">
   <a href="javascript:PopupPic('Image1.gif')">Image 1</a><br>
   <a href="javascript:PopupPic('Image2.gif')">Image 2</a><br>
   <a href="javascript:PopupPic('Image3.gif')">Image 3</a><br>
</BODY>
</HTML>

 

because of the

<a href="javascript:PopupPic('Image1.gif')">Image 1</a><br>

mine would need to be

<a href="javascript:PopupPic('<?php echo "mini1.php?id=$ID" ?>')">

which i dont think will work... cant be mixing javascript and php like that...? well i tested it and it didnt work lol... If someone has an Idea!!  ??? ???

 

Please help !! Been driving me nuts... :o::):-[ :-\ :'(

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.