[转]prototype.js函数介绍
来源:互联网 发布:编程基础知识 编辑:程序博客网 时间:2024/06/05 15:24
[转] http://okone96.itpub.net/post/9033/283688
函数名 解释 举例 Element.toggle 交替隐藏或显示 Element.toggle(''div1'',''div2'') Element.hide 隐藏 Element.hide(''div1'',''div2'') Element.show 显示 Element.show(''div1'',''div2'') Element.remove 删除 Element.remove(''div1'',''div2'') Element.getHeight 取得高度 Element.getHeight(''div1'') Toggle.display 和Element.toggle相同 Toggle.display(''div1'',''div2'') Insertion.Before 在DIV前插入文字 Insertion.Before(''div1'',''my content'') Insertion.After 在DIV后插入文字 Insertion.After(''div1'',''my content'') Insertion.Top 在DIV里最前插入文字 Insertion.Top(''div1'',''this is a text'') Insertion.Bottom 在DIV里最后插入文字 Insertion.Bottom(''div1'',''this is a text'') PeriodicalExecuter 以给定频率调用一段JavaScript PeridicalExecutor(test, 1)"这里test是Javascript的函数,1是频率(1秒). $ 取得一个DIV, 相当于getElementById() $(''div1'') Field.clear 清空一个输入框 Field.clear(''textfield1'') Field.focus 把焦点集中在输入框上 Field.focus(''select1'') Field.present 判断内容是否为空 alert(Field.present(''textfield1''))" Field.select 选择输入框的内容 Field.select(''textfield1'')" Field.activate 把焦点集中在输入框上并选择输入框的内容 Field.activate(''textfield1'')" Form.serialize 把表格内容转化成string Form.getElements 取得表格内容为数组形式 Form.disable disable表格所有内容 Form.disable(''form1'') (这个好象不work) Form.focusFirstElement 把焦点集中在表格第一个元素上 Form.focusFirstElement(''form1'') Form.reset Reset表格 Form.reset(''form1'') Form.Element.getValue 取得表格输入框的值 Form.Element.getValue(''text1'') Form.Element.serialize 把表格中输入框内容转化成string Form.Element.serialize(''text1'') $F 等同于Form.Element.getValue() $F(''text1'') Effect.Highlight 高亮特效. Effect.Highlight(''text1'') Effect.Fade 褪色特效 Effect.Scale 放大缩小(百分比)Effect.Scale(''text1'', 200)
这里200 = 200%, 即两倍
<DIV id="div1"><a href="#" onclick="new Element.toggle('div2')">Click Me</a></DIV>
<DIV id="div2">Hello!</DIV>
当点击Click Me的时候,div2就会交替隐藏或显示.注意,你可以给toggle加上无限个parameter,比如Element.toggle(''div2'',''div3'',''div4'',...)
- [转]prototype.js函数介绍
- prototype.js介绍
- prototype.js介绍
- prototype.js用法介绍
- js prototype介绍
- JS构造函数与原型prototype的区别介绍
- Prototype函数介绍
- prototype.js常用函数
- js-prototype函数
- [转]prototype.js开发笔记(针对Ajax的JS框架Prototype的使用介绍)
- [转]prototype.js开发笔记(针对Ajax的JS框架Prototype的使用介绍)
- prototype.js常用函数详解
- prototype.js简介- - [转]
- js中prototype用法详细介绍
- js中prototype用法详细介绍
- js中prototype用法详细介绍
- prototype.js常用函数及其用法
- prototype.js常用函数及其用法
- 软件监理与企业信息化的成败(上)
- C 读写磁盘文件专题
- Ubuntu下安装使用pidgin
- 软件监理与企业信息化的成败(下)
- ORACLE 截断字符串
- [转]prototype.js函数介绍
- 生活索引
- 什么是 System.Transactions(msdn)?
- 精讲MySQL 数据库的
- subthread(handling busy operation) notify mainthread to update UI
- 咨询公司细数ERP失败10大祸首
- 如何和何时使用多线程
- POJ 1781 的进一步优化
- SQL語法大全