Witam. Potrzebuje kodu JS który umożliwi po kilkuleciu w jeden link otworzenie dwóch okien w iframe i po kliknięciu w drugi link dwóch innych okien, również w iframe. Obecnie posiadam coś takiego, ino nie wiem jak to przerobić aby działało...
// ▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲ PLAYER ▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲
function addEvent(target, eve, func) {
if(target.addEventListener)
target.addEventListener(eve, func)
else if(target.attachEvent)
target.attachEvent("on" + eve, func)
else
eval(target + ".on" + eve + "=" + func + ";")
}
var play = document.getElementById("play");
var stop = document.getElementById("stop");
var frame1 = document.getElementById("frame1");
var frame2 = document.getElementById("frame2");
function changeFrames(location1, location2) {
frame1.src = location1;
frame2.src = location2;
}
addEvent(play, "click", function() {
changeFrames("radio/playerwindow.html", "radio/play.html");
});
addEvent(stop, "click", function() {
changeFrames("radio/stop.html", "radio/stop.html");
});
Jeszcze jakby ktoś mógł powiedzieć czemu na Chromie (fox działa) na stronie HOME nie działa mi kod JS z dźwiękiem po kliknięciu w menu lub przy zamykaniu X podstron
// ▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲ CLICK SOUND ▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲
var html5_audiotypes={
"mp3": "audio/mpeg",
"mp4": "audio/mp4",
"ogg": "audio/ogg",
"wav": "audio/wav"
}
function createsoundbite(sound){
var html5audio=document.createElement('audio')
if (html5audio.canPlayType){
for (var i=0; i<arguments.length; i++){
var sourceel=document.createElement('source')
sourceel.setAttribute('src', arguments[i])
if (arguments[i].match(/\.(\w+)$/i))
sourceel.setAttribute('type', html5_audiotypes[RegExp.$1])
html5audio.appendChild(sourceel)
}
html5audio.load()
html5audio.playclip=function(){
html5audio.pause()
html5audio.currentTime=0
html5audio.play()
}
return html5audio
}
else{
return {playclip:function(){throw new Error("Your browser doesn't support HTML5 audio unfortunately")}}
}
}
var clicksound=createsoundbite("mp3/click.ogg", "mp3/click.mp3")