PDA

View Full Version : Pop up windows



Foxman
03-02-2014, 08:06 PM
Am doing RAW HTML homepage. I click a link on homepage to read the next page in a pop up window smaller in size say 720x430 works perfect. I click a link in POP up window and need a new pop up window to appear so I have main homepage open, the 1st POP up window open and the 2nd POP up window open plays the audio link.

The script I have allows only 1 POP up window. If you click while in the POP up window you lose the page you had for the new . Help, I need the 2nd POP up to play MP3 audio in separate POP up...., what scrip does this?
Thanks;
Foxman

molendijk
03-03-2014, 11:12 AM
main.html:

<head>
<script>
var first_popup='popup1', second_popup='popup2', close_popup='';
</script>
</head>

<body>
<div id="popup1"></div>
<div id="popup2"></div>
<a href="javascript: void(0)" onclick="document.getElementById('popup1').innerHTML='<div style=\'position: absolute; margin-left: 50px; margin-top: 50px; width: 720px; height: 430px\'><div style=\'position: relative; float: right; cursor: pointer\' onclick=\'document.getElementById(first_popup).innerHTML=close_popup\'>CLOSE<\/div><br><iframe src=\'popup1.html\' style=\'position: absolute; width: 100%; height: 100%; border: 1px solid black\' frameborder=\'0\'><\/iframe><\/div>'">popup 1</a>
</body>

popup1.html:

<body>
<a href="javascript: void(0)" onclick="parent.document.getElementById('popup2').innerHTML='<div style=\'position: absolute; margin-left: 780px; margin-top: 50px; width: 720px; height: 430px\'><div style=\'position: relative; float: right; cursor: pointer\' onclick=\'parent.document.getElementById(second_popup).innerHTML=close_popup\'>CLOSE<\/div><br><iframe src=\'http://www.w3schools.com/html/horse.mp3\' style=\'position: absolute; width: 100%; height: 100%; border: 1px solid black\' frameborder=\'0\'><\/iframe><\/div>'">popup 2=audio</a>
</body>