Jump to content

How to make a pop up window within my script


sdpullen

Recommended Posts

Hey everyone. Is there a way to make an <a href> tag within my script for each of the dj's? I want it to where when the dj's picture is showing, you can click on their pic and it would pop up a small window and have all of their information.

Here is my script:

[code]
<?php
$Sigs=array('http://www.sikestonfirstmedia.org/jocks/wknd.jpg','http://www.sikestonfirstmedia.org/jocks/bobsherismall.jpg','http://www.sikestonfirstmedia.org/jocks/cjsmall.jpg','http://www.sikestonfirstmedia.org/jocks/joesmall.jpg','http://www.sikestonfirstmedia.org/jocks/lukesmall.jpg','http://www.sikestonfirstmedia.org/jocks/ronniesmall.jpg');
$times = array(2,7,12,17,22);
$time = date('H');
$day = date('D');
$w_days = array('Sun','Sat');
if (in_array($day,$w_days)) $i=0;
else {
$i = 0;
while ($time >= $times[$i]) $i++;
}
echo '<img src="',$Sigs[$i],'" >';
?>
[/code]

These are the links to the dj pictures:

'http://www.sikestonfirstmedia.org/jocks/wknd.jpg','http://www.sikestonfirstmedia.org/jocks/bobsherismall.jpg','http://www.sikestonfirstmedia.org/jocks/cjsmall.jpg','http://www.sikestonfirstmedia.org/jocks/joesmall.jpg','http://www.sikestonfirstmedia.org/jocks/lukesmall.jpg','http://www.sikestonfirstmedia.org/jocks/ronniesmall.jpg'

Thanks for your help!

Well, you can also use that same window.open function in your links directly.

<a href="#" onclick="window.open( 'http://www.google.com/', 'myWindow',
'status = 1, height = 300, width = 300, resizable = 0' );">

That should work.

Here is another good read on the subject:
http://www.sitepoint.com/article/perfect-pop-up

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.