Hi David,
Looking to open a link to an audio file (in my feed) in a popup window. Link is currently opening in a new window as follows.
<a href='<?php print $mainProduct["audio"]; ?>' target="_blank">Listen to Audio</a>
Have come across similar code for opening an image in a popup - http://www.pricetapestry.com/node/2765
Any ideas on how I would implement this code in this instance ?
Many thanks
Adrian
Hi Adrian,
Have a go with:
<script type='text/JavaScript'>
function popup(url)
{
var sw = screen.width;
var sh = screen.height;
var pw = 450;
var ph = 450;
var sx = (sw-pw)/2;
var sy = (sh-ph)/2;
popupWin = window.open(url,"","width="+pw+",height="+ph+",menubar=no,status=no,titlebar=no,toolbar=no,scrollbars=no,resizable=no,screenX="+sx+",screenY="+sy+",left="+sx+",top="+sy);
popupWin.focus();
}
</script>
<a onclick='JavaScript:popup("<?php print $mainProduct["audio"]; ?>")'>Listen to Audio</a>
Cheers,
David.