Close music window
I'm trying to have music playing uninterrupted across all pages of an html website project (site owner's request despite my advice). I'm using the following method :
1. when index.html is loaded, the music.html page also opens automatically in another window
2. the window containing music.html is automatically minimized
3. On each page of the project (i.e. not on the parent index.html page) there is a "Turn music off" button/link. When pressed, the music.html page window should be closing.
4. Ideally, the music.html page window should also be closing when the user closes the window containing the main site (index.html and the other site pages).
5. More ideally, the music.html page window should also be closing even if the user does not close the window containing the main site but just navigates away to another website.
I am now stuck with 3 and can't find how to do it (and I'm not even dreaming yet about 4 and 5...)
Can someone assist ?
I'm not sure you can do that. Once the browser navigates away from the parent window (initiating the js-called music window), you'd lose all your variables that control the child music window and/or its association to the "new" browser pages.
The only way I know of to do this is to have the user click on a link, and have the music come up in their default media player. Then, they can turn it off at will, as well as retain the music playing while navigating through the site.
Another way (though not recommended) is to use frames, where the music player is in the main frame layout and the content (within the frame) changes. But, that's really old-school/not-too-user-friendly coding.
Thanks for your reply KDLA.
Your suggestion to use a "start/stop" music link would also be my best choice, however the client insists that the music should auto-start when the site loads.
(I'm really tempted to forget all about the "music-off" button since the client is not concerned with it at all, but I want to be a responsible person and prevent future visitors of the site from having thoughts about hitting both me and the site owner on the head with things).
Anyway thanks for your post. I'll scratch my head again and hopefully I'll think of a different approach.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)