This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function () { | |
$('select.selectOnly').selectBox(html.selectBox.sb1); | |
$('input[type=radio]').radiobox(html.radiobox.rb2); | |
//clearTimeout | |
clearTimeout(realtime_haloTimer); | |
//mapInstance | |
var mapInstance; | |
//get canvas element | |
var canvas = document.getElementById('areaCode-canv'), | |
ctx = canvas.getContext('2d'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lan="en"> | |
<head> | |
<title>未知大小图片在已知大小容器水平/垂直居中</title> | |
<meta charset="UTF-8"> | |
<style type="text/css"> | |
#first { | |
/*非IE的主流浏览器识别的垂直居中的方法*/ | |
display: table-cell; | |
vertical-align:middle; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function createImageDataPressed (e) { | |
window.open(canv.toDataURL(),"cavasImage","left=0,top=0,width="+canv.width+",height="+canv.height+",toolbar=0,resizable=0"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function keyPressed(e){ | |
if(!game && guess>0){ | |
var keyPressed = String.fromCharCode(e.keyCode)//获得按下的键的值 | |
, keyPressedIndex; | |
keyPressed = keyPressed.toLowerCase(); | |
lettersGuessed.push(keyPressed); | |
keyPressedIndex = letters.indexOf(keyPressed); | |
if(keyPressedIndex >= 0){ | |
guess = guess - 1; | |
if(keyPressedIndex === index) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function initGame(){ | |
index = Math.floor(Math.random()*letters.length); | |
letterToGuess = letters[index]; | |
//console.log(letterToGuess); | |
lettersGuessed = []; | |
window.addEventListener('keyup',keyPressed,true); | |
var formElement = document.getElementById('createImageData'); | |
formElement.addEventListener('click',createImageDataPressed,false); | |
drawScreen(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var canv = document.getElementById('game') | |
, contxt = canv.getContext('2d') | |
, guess = 3 //猜测的次数 | |
, message = "Guess The Letter From a(lower) to z(higher)"//游戏提示 | |
, letters = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"] | |
, today = new Date()//日期显示 | |
, letterToGuess = ""//系统随机产生的待猜测的字母 | |
, letterToGArray = []//游戏结束时,用于显示待猜测字母 | |
, LowerOrHigher = ""//每次键按下后对用户提示 | |
, lettersGuessed//存放已经按过的字母 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function canvasApp() { | |
var canv = document.getElementById('game') | |
, contxt = canv.getContext('2d') | |
, guess = 3 | |
, message = "Guess The Letter From a(lower) to Z(higher)" | |
, letters = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"] | |
, today = new Date() | |
, letterToGuess = "" | |
, LowerOrHigher = "" | |
, lettersGuessed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//slide icon created by HTML5 canvas | |
(function(){ | |
var canv = $(‘#slide_icon’)[0]; | |
//canv.style.width=”300px“; | |
//canv.style.height=“300px”; | |
var cont = canv.getContext(’2d’); | |
//border cont.beginPath(); | |
cont.moveTo(8,10); | |
cont.arc(8,18,8,Math.PI*3/2,Math.PI,true); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>HTML5 Drag and Drop</title> | |
<style> | |
body { | |
background-color: #515151; | |
width: 100%; | |
height: 100%; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function prueba_estabilidad2(num, den) | |
sys = tf(num, den) | |
raices = roots(den) | |
nyquist(sys); | |
for i = 1:length(raices); | |
text(real(raices(i)), imag(raices(i)), "*"); | |
printf("%f, %f",real(raices(i)), imag(raices(i))) | |
endfor | |
endfunction |
NewerOlder