Hi All,
Im Making A Music Place For My Website,
Was Trying to add a new "addiction",
what this does is:
if you click the link it hides the music player and shows up in a popup.(ive done this) but this is the part i need help.
Is It Possible:
if you click the link again it will close the popup and show the music player?
my code so far:
Code:function Mpop() { ID = document.getElementById(2); if(ID.style.display == "") ID.style.display = "none"; else ID.style.display = ""; window.open( "http://music.game-dragon.com/bands/pop/pr.html", "myWindow", "status = 0, height = 200, width = 385, resizable = 0"); }



Reply With Quote

... Okay, so let's say that you have a link. Once you click it, the pop-up opens. We should tweak the code for when you click on it to where when the user clicks on it, a variable is made true or false. Okay. Let's say the user clicks on the link. After he/she clicks on the link, the link checks to see if the user already clicked on it (to where the pop-up would be open) by looking at a bool variable. If the variable is true, then the pop-up closes and the variable is made false. If the variable is false (in which case the user didn't click on the variable), the pop-up opens and the variable is made true. To close a pop-up, simply use window.close(window_name_opened_here). Any questions?
Bookmarks