Advertisement
Guest User

Untitled

a guest
Nov 5th, 2018
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function addEvent(target, eve, func) {
  2.         if(target.addEventListener)
  3.         target.addEventListener(eve, func)
  4.         else if(target.attachEvent)
  5.         target.attachEvent("on" + eve, func)
  6.         else
  7.         eval(target + ".on" + eve + "=" + func + ";")
  8.         }
  9.        
  10.         var play = document.getElementById("play");
  11.         var stop = document.getElementById("stop");
  12.         var frame1 = document.getElementById("frame1");
  13.         var frame2 = document.getElementById("frame2");
  14.        
  15.         function changeFrames(location1, location2) {
  16.             frame1.src = location1;
  17.             frame2.src = location2;
  18.         }
  19.        
  20.         addEvent(play, "click", function() {
  21.         changeFrames("radio/playerwindow.html", "radio/play.html");
  22.         });
  23.  
  24.         addEvent(stop, "click", function() {
  25.         changeFrames("radio/stop.html", "radio/stop.html");
  26.         });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement