home
-
log
- v0.3.5 :+: mp4 player.
function blMp4Player(id,src){ var r = document.getElementById(id); if(!r){ r = document.createElement("video"); r.id = id; r.style.border = "1px solid green"; } r.src = src; document.body.appendChild(r); return r; } var mp4p = blMp4Player("mp4p","dvd2_3_1.mp4");
function blIframe(id,src){ var r = document.getElementById(id); if(!r){ r = document.createElement("iframe"); r.id = id; r.style.border = "1px solid red"; } r.src = src; document.body.appendChild(r); return r; } var i1 = blIframe("i1","mi.bat"); var i2 = blIframe("i2","mp4i.bat");
function blCanvas(id,html){ var r = document.getElementById(id); if(!r){ r = document.createElement("canvas"); r.id = id; r.style.border = "1px solid blue"; } r.innerHTML = html; r.onclick = function(){alert(id);} document.body.appendChild(r); return r; } var c1 = blCanvas("c1","c1"); var c2 = blCanvas("c2","c2"); c2.onclick = function(){alert("CCCC2");} c2.onmousemove = function(){ var c = document.getElementById("c2"); var ctx = c.getContext("2d"); ctx.beginPath(); var w = this.width; var h = this.height; ctx.fillStyle = "red"; ctx.fillRect(0,0,w,h); var coord = coordinate(event); var x = coord.coord_X; var y = coord.coord_Y; ctx.moveTo(0,0); ctx.lineTo(x,y); var r = 20; ctx.arc(x,y,r,0,2*Math.PI); ctx.stroke(); ctx.font = "20px Arial"; ctx.fillStyle = "blue"; var s = "("+x+","+y+")"; ctx.fillText(s,x,y); }
function blDiv(id,html){ var r = document.getElementById(id); if(!r){ r = document.createElement("div"); r.id = id; r.style.border = "1px solid #3d3d3d"; } r.innerHTML = html; r.onclick = function(){alert(id);} document.body.appendChild(r); return r; } var d1 = blDiv("d11","d1b"); var d2 = blDiv("d2","d2"); d2.onclick = function(){alert("ddfdd2");}
function blBtn(id,html){ var r = document.getElementById(id); if(!r){ r = document.createElement("button"); r.id = id; } r.innerHTML = html; r.onclick = function(){alert(id);} document.body.appendChild(r); return r; } var b1 = blBtn("b1","b1b"); var b2 = blBtn("b2","x2"); b2.onclick = function(){alert("x2");}