發光打字效果

  • style="font-size:15px;color:000000;filter:glow(color:66ff33);width:400;

  • 15px文字大小

  • 66ff33更改發光顏色width:400;為顯示區的寬度<SCRIPT Language="JavaScript">

  • text = "請更改為你想要的句子"


<!--語 法 開 始-->
<div id='ttli' style="font-size:15px;color:000000;filter:glow(color:66ff33);width:300;text-align:left"></div>
<SCRIPT Language="JavaScript">
text = "您現在所看到的是 發光的打字效果,希望您會喜歡,您可以自行更改發光顏色,文字大小,顯示區域的寬度,也可以搭配定位效果去做位置控制!"
word = text.split('.')
i = -1;
j = 0;
start = 0;
scount = 0;
function checkIt() {
with(document.all.ttli) {
if(innerText.charAt(innerText.length-1) == "_") {
innerText = innerText.substring(0, innerText.length - 1);
return true;
}
else {
innerText = innerText + "_";
return false;
}
}
}
function blinkfor(count, timing) {
with(document.all.ttli) {
if(start < count) {
if(checkIt()) {
start++;
}
mistake = 'blinkfor('+count+','+timing+')';
setTimeout('eval(mistake)', timing);
}
else {
start = 0;
i++;
call_It();
}
}
}
function mispell(offset,correction) {
with(document.all.ttli) {
if(scount < offset) {
if(!checkIt()) {
innerText = innerText.substring(0, innerText.length-2) + "_";
scount++;
}
mistake = 'mispell(' + offset + ', "' + correction + '")';
setTimeout("eval(mistake)", 150);
}
else {
if(correction == '' && scount == offset ) {
i = i - offset;
scount++;
}
if(offset > 0) {
if(checkIt()) {
innerText += correction.charAt(correction.length - offset) + "_";
offset--;
}
mistake = 'mispell(' + offset + ',"' + correction + '")';
setTimeout("eval(mistake)", 150);
}
else {
scount = 0;
j++;
innerText = innerText.substring(0, innerText.length - 1);
call_It();
}
}
}
}
function spellit(string) {
with(document.all.ttli) {
if(i <= string.length) {
if(string.charAt(i) == '/') {
NumErrs = string.charAt(i + 1);
NewLets = string.substring(i + 2, i + NumErrs);
mispell(NumErrs,NewLets);
}
else if(i <= string.length - 1) {
i++;
innerText = string.substring(0,i) + "_";
mistake = 'spellit("' + string + '")';
setTimeout("eval(mistake)", 150);
}

else {
innerText = string.substring(0, i);
j++;
call_It();
}
}
}
}
function call_It() {
with(document.all) {
if(i == -1){
blinkfor(4, 150);
}
else if(j <= word.length - 1) {
spellit(ttli.innerText + " " + word[j]);
}
else {
blinkfor(100,230);
}
}
}
if(document.all) {
call_It();
}
</SCRIPT>
<!--語 法 結 束-->

arrow
arrow
    全站熱搜

    nicole 發表在 痞客邦 留言(0) 人氣()