views:

1471

answers:

2

I am currently coding a website for a band and i have a music player located within a frame in the website. I would like to make the music player pop out from within the page when i click on a button.

I was wondering if there was some sort of javascript/jquery code i can employ for this function. If not, what other work-around can i use to achieve this.

If possible, as part of the function, i would like the frame to close from the window after it has popped out, and the other frame to load up as a complete website.

+2  A: 

If you must... ;)

http://javascript.internet.com/generators/popup-window.html

routeNpingme
cheers mate. do you know how to close the frame after the pop-up button has been clicked to reveal the entire website from the other frame.
Seedorf
You can change the browser address to a non-frames page in Javascript. But why wouldn't you just ditch the frames altogether at this point? There's no reason for them if you have a button that opens a window with the music player.
routeNpingme
A: 

You can call javascript window.open() function from your flash music player with ExternalInterface.call() (and make sure you've set allowScriptAccess=samedomain as flash param in html for it to work).

Then open your music player swf in a popup with some additional parameter attached, so you know that it lives in popup window.

To make the popup version continue playing where framed one was at, you can use a LocalConnection call. The framed version would listen for LocalConnection, and expose its current play state (what is playing, at what second etc) and popped up version could ask for this and continue exactly from the same place. This will make the popping up experience much smoother for end user.

Finally the framed player can call additional javascript functions via ExternalInterface.call() to remove itself from framed document's DOM.

Tehnomaag