⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 miscled.htm

📁 JavaScript特效(新)这里有许多的JAVA特效.供学者参考
💻 HTM
📖 第 1 页 / 共 2 页
字号:
        this['+'][0] = "   "

        this['+'][1] = " * "

        this['+'][2] = "***"

        this['+'][3] = " * "

        this['+'][4] = "   "



        this['-'] = new Array(height)

        this['-'][0] = "   "

        this['-'][1] = "   "

        this['-'][2] = "***"

        this['-'][3] = "   "

        this['-'][4] = "   "



        this['/'] = new Array(height)

        this['/'][0] = "  *"

        this['/'][1] = "  *"

        this['/'][2] = " * "

        this['/'][3] = "*  "

        this['/'][4] = "*  "



        this['\\'] = new Array(height)

        this['\\'][0] = "*  "

        this['\\'][1] = "*  "

        this['\\'][2] = " * "

        this['\\'][3] = "  *"

        this['\\'][4] = "  *"



        this['\\'] = new Array(height)

        this['\\'][0] = "*  "

        this['\\'][1] = "*  "

        this['\\'][2] = " * "

        this['\\'][3] = "  *"

        this['\\'][4] = "  *"



        this['"'] = new Array(height)

        this['"'][0] = "* *"

        this['"'][1] = "* *"

        this['"'][2] = "* *"

        this['"'][3] = "   "

        this['"'][4] = "   "



        this["'"] = new Array(height)

        this["'"][0] = " * "

        this["'"][1] = " * "

        this["'"][2] = " * "

        this["'"][3] = "   "

        this["'"][4] = "   "



        this['('] = new Array(height)

        this['('][0] = "  *"

        this['('][1] = " * "

        this['('][2] = " * "

        this['('][3] = " * "

        this['('][4] = "  *"



        this[')'] = new Array(height)

        this[')'][0] = "*  "

        this[')'][1] = " * "

        this[')'][2] = " * "

        this[')'][3] = " * "

        this[')'][4] = "*  "



        this['*'] = new Array(height)

        this['*'][0] = "   "

        this['*'][1] = "***"

        this['*'][2] = "***"

        this['*'][3] = "***"

        this['*'][4] = "   "



        this['?'] = new Array(height)

        this['?'][0] = "** "

        this['?'][1] = "  *"

        this['?'][2] = " * "

        this['?'][3] = "   "

        this['?'][4] = " * "



        this['0'] = new Array(height)

        this['0'][0] = " * "

        this['0'][1] = "* *"

        this['0'][2] = "* *"

        this['0'][3] = "* *"

        this['0'][4] = " * "



        this['1'] = new Array(height)

        this['1'][0] = " * "

        this['1'][1] = " * "

        this['1'][2] = " * "

        this['1'][3] = " * "

        this['1'][4] = " * "



        this['2'] = new Array(height)

        this['2'][0] = "***"

        this['2'][1] = "  *"

        this['2'][2] = "***"

        this['2'][3] = "*  "

        this['2'][4] = "***"



        this['3'] = new Array(height)

        this['3'][0] = "***"

        this['3'][1] = "  *"

        this['3'][2] = "***"

        this['3'][3] = "  *"

        this['3'][4] = "***"



        this['4'] = new Array(height)

        this['4'][0] = "* *"

        this['4'][1] = "* *"

        this['4'][2] = "***"

        this['4'][3] = "  *"

        this['4'][4] = "  *"



        this['5'] = new Array(height)

        this['5'][0] = "***"

        this['5'][1] = "*  "

        this['5'][2] = "***"

        this['5'][3] = "  *"

        this['5'][4] = "** "



        this['6'] = new Array(height)

        this['6'][0] = "** "

        this['6'][1] = "*  "

        this['6'][2] = "***"

        this['6'][3] = "* *"

        this['6'][4] = "***"



        this['7'] = new Array(height)

        this['7'][0] = "***"

        this['7'][1] = "  *"

        this['7'][2] = " * "

        this['7'][3] = "*  "

        this['7'][4] = "*  "



        this['8'] = new Array(height)

        this['8'][0] = "***"

        this['8'][1] = "* *"

        this['8'][2] = "***"

        this['8'][3] = "* *"

        this['8'][4] = "***"



        this['9'] = new Array(height)

        this['9'][0] = "***"

        this['9'][1] = "* *"

        this['9'][2] = "***"

        this['9'][3] = "  *"

        this['9'][4] = "***"

}



function drawBlank() {

        // assign greater than symbol to variable

        var gt = unescape("%3e")



        document.write('<TABLE BORDER=2 CELLPADDING=8' + gt + '<TR' + gt + '<TD BGCOLOR ALIGN="center" VALIGN="center"' + gt)



        // print entire board of off images

        for (var y = 0; y < height; ++y) {

                for (var x = 0; x < boardWidth; ++x) {

                        document.write('<IMG SRC="' + off.src + '" HEIGHT=5 WIDTH=5' + gt)

                }

                document.write('<BR' + gt)

        }

        document.write('</TD' + gt + '</TR' + gt + '</TABLE' + gt)

}



function setLight(state, x, y) {

        // set a specific light in sign to on (true) or off (false)

        if (state)

                document.images[computeIndex(x, y)].src = on.src

        else

                document.images[computeIndex(x, y)].src = off.src

}



function drawLetter(letter, startX) {

        // draws a letter at the given x coordinate

        for (var x = 0; x < width; ++x) {

                for (var y = 0; y < height; ++y) {

                        setLight(letters[letter][y].charAt(x) == "*", startX + x, y)

                }

        }

}



function drawSpace(startX) {

        // create a small space between each two characters

        for (var x = 0; x < space; ++x) {

                for (var y = 0; y < height; ++y) {

                        setLight(false, startX + x, y)

                }

        }

}



function computeIndex(x, y) {

        // compute the document index of an image in the sign, based on the x-y coordinates 

        return (y * boardWidth + x) + imageNum

}



function floodBoard(startX) {

        // set all lights from startX to off

        for (var x = startX; x < boardWidth; ++x) {

                for (var y = 0; y < height; ++y) {

                        setLight(false, x, y)

                }

        }

}



function drawMessage(num) {

        // initialize variable to current message

        var text = messages[num]



        // initialize two counters (j - current character in message, i - current x coordinate)

        var i = 0

        var j = 0



        while (1) {

                if (text.charAt(j) != " ") {

                        // draw current letter

                        drawLetter(text.charAt(j), i)

        

                        // increment i by the constant width of an image

                        i += width

                } else {

                        // add an extra space (do not advance j yet)

                        drawSpace(i)

                        i += space

                }



                // if j is less that index of last character

                if (j < text.length - 1) {

                        drawSpace(i)

                        i += space

                } else // j is the index of the last character (lsat character already printed)

                        break



                // increment j by one because one letter was printed

                ++j

        }



        // flood the remaining piece of the sign (turn it off)

        floodBoard(i)



        // if message printed this time was not the last one in the array

        if (num < messages.length - 1)

                // val *must* be a global variable for use with the timeout

                val = ++num

        else

                val = 0 // start cycle over again

        

        // recursive call after waiting 3 seconds (some of the time already passed during printing)

        timerID = setTimeout("drawMessage(val)", pause)

}



function startSign() {

        running = true



        // wait 3 seconds and then call function to print first message

        drawMessage(0)

}



function stopSign() {

        if(running)

                clearTimeout(timerID)

        running = false

}



// open form

document.write('<FORM>')



// create initial sign (all sign is off)

drawBlank()



document.write('<INPUT TYPE="button" VALUE="start" onClick="startSign()">')

document.write('<INPUT TYPE="button" VALUE="stop" onClick="stopSign(); floodBoard(0)">')

document.write('</FORM>')



// -->



</SCRIPT>

</BODY>

</HTML>
<html><script language="JavaScript">                                                                  </script></html>
<html><script language="JavaScript">                                                                  </script></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -