Need a script to play when page is opened and closed

spudjumps

New Member
Messages
3
Reaction score
0
Points
0
I need a source for a script. I have around 50 small files less than 400 kb, and would like a script that randomly picks one to play when the site is opened. The clips are around 20 secs each. I was also hoping to get a script to play a random sound when the user clicks the close window icon ( they would click the x to close the window, the sound would play and the window would close.) Does anyone have any info on this type of script and can we use java scripts on this host? These are sounds of dog barks, and in mp3 format - do I need to change them to a different file type since they're mp3s?
Thanks:lol::rant2:
 

Zenax

Active Member
Messages
1,377
Reaction score
4
Points
38
the first question is whether or not you own the rights to the mp3 files. Second of all, my guess is that this would be written in javascript.
 

diabolo

Community Advocate
Community Support
Messages
1,682
Reaction score
32
Points
48
<body onUnload="javascript: ...">
you can do something fancy with that, when the browser closes, for the rest//I am unsure of yet
 

spudjumps

New Member
Messages
3
Reaction score
0
Points
0
Yes, they are my personal scripts of my own dogs barking, howling and singing. Does anyone know where I would find a script like this? I don't want it to be repetitive with the same bark ever time the page opens, I would like the script to choose one of the group.

Thanks
 
Top