Javascript和ascii作业

时间:2013-12-02 21:22:20

标签: javascript html ascii

我有一个任务,我必须选择一个动画并运行它。它工作,除了turbo功能不像它的假设,我不知道如何更改字体大小这里是链接http://turing.plymouth.edu/~besopko/hw6/ascii.html

我的php是:

var frameStr;
var frameSeq;
var currentFrame;
var frameanime;
var q;
var startspeed = 250;

function startFunction(){
  frameStr = document.getElementById("Frame").value;
  if(frameStr.indexOf("\r\n")!=-1){
    frameSeq = frameStr.split("=====\r\n");
  }
  else{
    frameSeq = frameStr.split("=====\n");
    currentFrame = 0;
    q = setInterval(NextFrame, startspeed);
  }
}

function AnimeFunction(){
 frameanime = document.getElementById("animation").value;
  if(frameanime == "EXERCISE"){
    $("Frame").value = EXERCISE;  
  }
  else if(frameanime == "JUGGLER"){
    $("Frame").value = JUGGLER;
  }
  else if(frameanime == "BIKE"){
    $("Frame").value = BIKE;
  }
  else if(frameanime == "DIVE"){
    $("Frame").value = DIVE;
  }
  else if(frameanime == "CUSTOM"){
    $("Frame").value = CUSTOM;
  }
}

function NextFrame(){
  document.getElementById("Frame").value = frameSeq[currentFrame];
  currentFrame = (currentFrame+1)% frameSeq.length;
}

function stopFunction(){
  clearInterval(q);
}

//this function isn't working properly
function turboFunction(){
  var speed = document.getElementById("speed1");
  if(speed.checked){
    startspeed = 50;
    q = setInterval(nextFrame, startspeed);
  }
  else {
    startspeed = 250;
    q = setInterval(nextFrame, startspeed);
  }

}
function sizeFunction(){
 text = document.getElementById("size").value;
 if(text == "tiny"){
 $("Frame").value = //stuck here;
}

}

我不确定为什么turboFunction()工作不正确而且我不确定如何更改ascii动画的字体大小。任何输入都会非常有用。

0 个答案:

没有答案