prototype.js常用函数:?
函数名 解释 举例?
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%, 即两倍?
Effect.Squish 消失特效.文字缩小后消失 Effect.Squish(''text1'')?
Effect.Puff 消失特效.文字放大后消失 Effect.Puff(''text1'')?
Effect.Appear 出现特效
Effect.ContentZoom ZOOM特效.
Ajax.Request 传送Ajax请求给服务器 Ajax.Request(''http://server/s.php'')?
Ajax.Updater 传送Ajax请求给服务器并用答复的结果更新指定的Container Ajax.Updater(''text1'',''http://server/s.php'')?
????? 基本用法:prototype.js给每个主要的类都分了一个Class,使用起来很方便.要产生特定的效果,只要用new Class.function(<argument>)就可以了.例如:?
<pre><DIV id="div1"><a href="#" onclick="new Element.toggle('div2')">Click Me</a></DIV>?
<DIV id="div2">Hello!</DIV>pr e>?
????? 当点击Click Me的时候,div2就会交替隐藏或显示.注意,你可以给toggle加上无限个parameter,比如Element.toggle(''div2'',''div3'',''div4'',...)?
详细解决方案
prototype.js惯用函数
热度:77 发布时间:2012-10-29 10:03:53.0
相关解决方案
- spring @Scope("prototype")注解更新有关问题,寻求帮助
- 关于下载Nokia Prototype SDK4.0的有关问题
- prototype.js有没有解决浏览器兼容的有关问题 和 便于搜索引擎索引的有关问题
- 使人头晕向转的 prototype!解决思路
- Array.prototype.slice.call开个贴子!看看这玩意是什么东西!网上看到的不太明白。解决思路
- 用CSS添<ul> + prototype.js + cookiejar.js 作一个菜单
- prototype 的 $super是什么,该怎么解决
- ext this.model.prototype 有关问题
- AJAX(prototype)兑现的局部刷新搜索框实例
- prototype ajax驱除本地缓存
- prototype ajax传递参数乱码解决办法
- ajax prototype 批改 textbox 的值
- jquery prototype 主要区别?该怎么解决
- 为啥typeof Function.prototype==='function'
- 前端性能优化:施用Array.prototype.join代替字符串连接
- 前端性能优化:应用Array.prototype.join代替字符串连接
- instanceof 跟 prototype 关系
- 解决jquery 和 prototype 的冲突有关问题
- jQuery 跟 prototype 选择器的使用与注意事项
- 采取struts1.2+prototype,中文信息为双数时,显示正常,单数时,变成花符
- String.prototype.replace(str,func) 例中func的参数有关问题
- prototype 1.6.0.1上 getElementsByClassName 的bug
- prototype 遇到个有关问题 大家看看有没有遇到过
- prototype.js1.7.1在IE停getOffsetParent()会返回body
- js构造函数原型(prototype)有关问题分析(一段烂代码引发的博客)
- prototype.js 跟 jQuery.js ajax 调用
- javascript 类属性、类方法、种实例、实例属性、实例方法、prototype、proto_ 测试与小结
- ――prototype 有关问题
- javascript 类属性、类方法、种实例、实例属性、实例方法、prototype
- Struts 1.1 Validator 与 prototype 冲突 有关问题 解决(从51cto移过来)