-

「aaa」の編集履歴(バックアップ)一覧はこちら

aaa」(2013/07/17 (水) 21:06:43) の最新版変更点

追加された行は緑色になります。

削除された行は赤色になります。

#javascript(){{ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>逃げるボタン</title> <!-- <style ="text/css"> #id_div_par { position:relative; width:350px; height:350px; border:Solid 1px Black; } #id_div { position:absolute; padding:40px; border:Solid 1px Red; } #id_btn_reset { z-index:2; } </style> --> <script type="text/ "> //<![CDATA[ var intDistance = 15; var bEscaping = false; var strDirection = null; var strDirectionArray = new Array('Up', 'Down', 'Left', 'Right'); function errorEnvironment() { alert('ご使用の環境では、このスクリプトはご使用できません。'); } function byId(id) { return .getElementById(id); } function addEvent(evt, func, cap) { if (this.addEventListener) this.addEventListener(evt, func, cap); else if (this.attachEvent) this.attachEvent('on' + evt, func); else errorEnvironment(); } Object.prototype.addEvent = addEvent; HTMLDocument.prototype.addEvent = addEvent; Element.prototype.addEvent = addEvent; function removeEvent(evt, func, cap) { if (this.removeEventListener) this.removeEventListener(evt, func, cap); else if (this.detachEvent) this.detachEvent('on' + evt, func); else errorEnvironment(); } Object.prototype.removeEvent = removeEvent; HTMLDocument.prototype.removeEvent = removeEvent; Element.prototype.removeEvent = removeEvent; function addTop(elm, intOffsetY) { if (!elm.hasEscapeTop) { elm.hasEscapeTop = true; elm.escapeTop = 0; } elm.escapeTop += intOffsetY; elm.style.top = String(elm.escapeTop) + 'px'; } function addLeft(elm, intOffsetX) { if (!elm.hasEscapeLeft) { elm.hasEscapeLeft = true; elm.escapeLeft = 0; } elm.escapeLeft += intOffsetX; elm.style.left = String(elm.escapeLeft) + 'px'; } function doEscapeCore(intTimes) { if (!intTimes) { cancelEscape(); return; } if (!window.strDirection) { bEscaping = true; var intDirection = Math.floor(Math.random() * 4); window.strDirection = window.strDirectionArray[intDirection]; } var elm = byId('id_div'); var intOffsetY = (window.strDirection == 'Up') ? (0 - window.intDistance) : (window.strDirection == 'Down') ? window.intDistance : 0; var intOffsetX = (window.strDirection == 'Left') ? (0 - window.intDistance) : (window.strDirection == 'Right') ? window.intDistance : 0; addTop(elm, intOffsetY); addLeft(elm, intOffsetX); window.setTimeout('doEscapeCore(' + String(intTimes - 1) + ');', 50); } function doEscape(intTimes) { if (window.bEscaping) return; window.bEscaping = true; doEscapeCore(intTimes) } function cancelEscape() { window.strDirection = null; window.bEscaping = false; byId('id_txt_dir').value = window.strDirection; } function resetEscape() { window.strDirection = null; window.bEscaping = false; var elm = byId('id_div'); elm.hasEscapeTop = false; elm.hasEscapeLeft = false; addTop(elm, 0); addLeft(elm, 0); } function doClick() { alert('あら、捕まってしまったわ!') } function onWindowLoad() { var par, elm; par = byId('id_div_ '); elm = document.createElement('input') elm.id = 'id_btn_reset' elm.type = 'button'; elm.value = 'ボタン位置の '; elm.addEvent('click', function () { resetEscape(); }, false); par.appendChild(elm); par = byId('id_div_base'); elm = document.createElement('div') elm.id = 'id_div_par' elm.style.position = 'relative'; elm.style.width = '350px'; elm.style.height = '500px'; elm.style.height = '200px'; elm.style.borderStyle = 'Solid'; elm.style.borderWidth = '1px'; elm.style.borderColor = 'Black'; par.appendChild(elm); par = byId('id_div_par'); elm = document.createElement('div') elm.id = 'id_div' elm.style.position = 'absolute'; elm.style.padding = '40px'; elm.addEvent('click', function () { doEscape(8); }, false); elm.addEvent('mouseover', function () { doEscape(4); }, false); elm.addEvent('mousemove', function () { doEscape(4); }, false); par.appendChild(elm); par = byId('id_div'); elm = document.createElement('input') elm.id = 'id_btn' elm.type = 'button'; elm.value = 'わたしを捕まえて!'; elm.addEvent('click', function () { doClick(); }, false); elm.addEvent('mouseover', function () { canselEscape(); doEscape(8); }, false); par.appendChild(elm); par = byId('id_div_base'); elm = document.createElement('input') elm.id = 'id_btn_reset_2' elm.type = 'button'; elm.value = 'ボタン位置のリセット'; elm.addEvent('click', function () { resetEscape(); }, false); par.appendChild(elm); } window.addEvent('load', onWindowLoad, true); //]] </script> </head> <body> <div id="id_div_base"> </div> </body> </html> }}
#javascript(){{ <html> <head> <title>You are an idiot!</title> </head> <body bgColor=#ffffff leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="100%" height="100%"> <param name=movie value="youare.swf"> <param name=quality value=high> <embed src="youare.swf" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="100%" height="100%"> </embed> </object> </body> </html> }}

表示オプション

横に並べて表示:
変化行の前後のみ表示: