Javascript之第三方程序库

应用第三方程序库可以很快速的实现很酷炫的功能;

比如使用Scrip.aculo.us的功能

1)http://script.aculo.us/downloads下载文档“scriptaculous-js-x.x.x”;在网页中还有相关的说明“document”

2)主要是需要其中的2个文件:lib文件中的prototype.js(Prototype程序库);src文件中的effect.js(效果函数)

3)测试代码:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
    <title>Test script.aculo.us effects</title>
    <script type="text/javascript" src="scriptaculous-js-1.9.0/lib/prototype.js">
    </script>
    <script type="text/javascript" src="scriptaculous-js-1.9.0/src/effects.js">
    </script>
</head>
<body>
    <h1>Testing script.aculo.us Effets</h1>
    <form name="form1">
        <input type="button" value = "Fade out" onClick="new Effect.Fade($('text'))">
        <input type="button" value= "Fade in" onClick="new Effect.Appear($('text'))">
        <input type="button" value = "Highlight" onClick = "new Effect.Highlight($('text'))">
    </form>
    <div id="text" style="vackground-color:#CCC; margin:20px; padding:10px;">
        <h2>Testing Effects</h2>
        <p>This section of the document is within</p>
    </div>
</body>
</html>

 

posted @ 2015-07-16 19:40  Kinthon  阅读(840)  评论(0编辑  收藏  举报