prototype function and its use of common

2011-01-07  来源:本站原创  分类:Web  人气:94 

prototype function and its use of common

prototype.js commonly used functions:

Function name

Explained

Example

Element.toggle

Alternately hide or show

Element.toggle (''div1'','' div2'')

Element.hide

Hide

Element.hide (''div1'','' div2'')

Element.show

Display

Element.show (''div1'','' div2'')

Element.remove

Delete

Element.remove (''div1'','' div2'')

Element.getHeight

Achieved a high degree of

Element.getHeight (''div1'')

Toggle.display

And Element.toggle same

Toggle.display (''div1'','' div2'')

Insertion.Before

Insert text before the DIV

Insertion.Before (''div1'','' my content'')

Insertion.After

Insert text in the DIV

Insertion.After (''div1'','' my content'')

Insertion.Top

DIV inserted before the word most

Insertion.Top (''div1'','' this is a text'')

Insertion.Bottom

Insert text in the DIV in the final

Insertion.Bottom (''div1'','' this is a text'')

PeriodicalExecuter

To call a given frequency JavaScript

PeridicalExecutor (test, 1) "This test is a Javascript function, 1 is the frequency (1 second).

$

Get a DIV, equivalent to getElementById ()

$ (''Div1'')

Field.clear

Clear input box

Field.clear (''textfield1'')

Field.focus

To focus on input box

Field.focus (''select1'')

Field.present

Determine whether the content is empty

alert (Field.present (''textfield1''))"

Field.select

Select the contents of the input box

Field.select (''textfield1'') "

Field.activate

To focus on the input box and select the contents of the input box

Field.activate (''textfield1'') "

Form.serialize

String into the table of contents

Form.getElements

Table of contents for the array to obtain

Form.disable

disable all the contents of the form

Form.disable (''form1'') (this seems to not work)

Form.focusFirstElement

To focus on the first element in the table

Form.focusFirstElement (''form1'')

Form.reset

Reset Form

Form.reset (''form1'')

Form.Element.getValue

To obtain the value of form input box

Form.Element.getValue (''text1'')

Form.Element.serialize

The contents of the table into the input box string

Form.Element.serialize (''text1'')

$ F

Equivalent Form.Element.getValue ()

$ F (''text1'')

Effect.Highlight

Highlight effects.

Effect.Highlight (''text1'')

Effect.Fade

Fading effects

Effect.Scale

Zoom (Percentage)

Effect.Scale (''text1'', 200)
Where 200 = 200%, or twice the

Effect.Squish

Effects disappear. Reduce text disappear after

Effect.Squish (''text1'')

Effect.Puff

Effects disappear. Enlarge text disappear after

Effect.Puff (''text1'')

Effect.Appear

Effects appear

Effect.ContentZoom

ZOOM effects.

Ajax.Request

Send Ajax requests to the server

Ajax.Request (''http://server/s.php'')

Ajax.Updater

Send Ajax requests to the server and use the results of updating the specified reply Container

Ajax.Updater (''text1'','' http://server/s.php'')

Basic usage: prototype.js to each major sub-class of a Class, easy to use. To produce a particular effect, as long as new Class.function (<argument>) on it. For example:

<DIV> <a Href="#"> Click Me </ a> </ DIV>

<DIV> Hello! </ DIV>

When you click on Click Me time, div2 will alternately hide or show. Note that you can toggle with an unlimited number of parameter, such as Element.toggle (''div2'','' div3'','' div4'', ...)

相关文章
  • prototype function and its use of common 2011-01-07

    prototype function and its use of common prototype.js commonly used functions: Function name Explained Example Element.toggle Alternately hide or show Element.toggle (''div1'','' div2'') Element.hide Hide Element.hide (''div1'','' div2'') Element.sho

  • oracle, mysql function of the difference between common 2010-03-25

    racle mysql function of the difference between common group by, wmsys.wm_concat, group_concat: oracle: select yhid, yh, wmsys.wm_concat (mc) mc from dm group by yhid, yh mysql: select yhid, yhd, group_concat (mc) mc from dm group by yhd group by: in

  • Re javascript step deep understanding of Function.prototype 2010-06-13

    Today, nothing in bed reading a book, turn to "JavaScript language the essence of" 33 years, a very ordinary, very familiar with the process, I imagined wrong. References - "By adding a method to Function.prototype way, we do not have to ty

  • ThinkPHP调用common/common.php函数提示错误function undefined的解决方法 2015-03-26

    这篇文章主要介绍了ThinkPHP调用common/common.php函数提示错误function undefined的解决方法,是进行ThinkPHP程序设计的升级过程中经常会遇到的问题,需要的朋友可以参考下 本文主要介绍了ThinkPHP调用common/common.php函数提示错误function undefined的解决方法.对于采用ThinkPHP进行项目开发的朋友来说,在进行ThinkPHP升级后经常会遇到这类问题.具体描述如下: 在对ThinkPHP升级后使用了最新的Thin

  • function foo的原型与prototype属性解惑 2015-04-30

    最近在研究js,疑惑也比较多.主要是被原型这个东西给弄迷糊了. 疑惑出自于: function foo { this.name = 'foo'; } alert(foo.prototype === Function.prototype ); //false. 当时一直没想明白为啥foo的原型不是Function.prototype. 下面例子让我想当然的认为o.prototype === Function.prototype 应该为true的: 复制代码 代码如下: function foo()

  • Prototype examples of learning 2009-12-11

    Prototype examples of learning Prototype combat ---- 1. $ $ Java code <html> <head> <title> Test $ $ </ title> <script src="prototype.js"> </ script> <script> function test $$(){ /**//* in case CSS is no

  • [ExtJS3.2 source one hour a day] ExtJS extension of the Function category (of 9) 2010-09-17

    Ext extension of the Function class includes four methods: common implementation interceptor function to create a callback function, create the commission, the delay function to perform. Ext.apply(Function.prototype, { // Function implementation inte

  • [Transfer] prototype prototype chain to understand 2011-01-11

    prototype prototype chain prototype from the French, the software industry's standard translation is "prototype", on behalf of the initial shape of things, also contains the meaning of models and model. JavaScript concept prototype in the word a

  • js里的prototype使用示例 2014-05-14

    Object对象是common的原型,Object对象的属性和方法复制到了common上 <script type="text/javascript"> function people(name){ this.name=name; this.introduce=function(){ //对象方法 alert("my name is"+this.name); } } people.run=function(){ //类方法 alert("i c

  • Practical small JavaScript function (1) 2009-03-10

    1. To confirm the deletion function confirmit() { if(confirm("Are you sure to delete this file? ")) { document.form1.submit(); } } <form name="form1" action=1.html> <input type="button" value="ok"/> <

  • JS prototype example 2010-03-29

    prototype property returns a reference to the prototype object type. With the prototype property of the object's class provides a set of basic functions. A new instance of the object "inheritance" given to the object prototype operation, pay att

  • Lazy special - good use SciTE abbreviation for function 2010-03-28

    Lazy special - good use SciTE abbreviation for function Transfer from http://bbs.ctex.org/viewthread.php?tid=43620 Layout using SciTE a lot of people who should be it, this editor is a very powerful feature of his short (Abbreviation) start function.

  • Oracle Function Index depth 2010-02-23

    http://database.51cto.com/art/200911/164250.htm Oracle is still relatively common, so I studied a bit Oracle function indexes out here and share with you, we want to be useful. 1.Oracle function index benefits: Exp: function (column1), if the table h

  • Sorting out the form with function 2010-04-27

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head> <title>K2046.TableSorter<

  • JavaScript function named 2010-06-03

    Function expression is actually very common. Web developers have a common approach, that is based on certain characteristics of the test to "mask" function definition, in order to achieve optimal performance. Since this is usually disguised in t

  • JavaScript prototype study notes (change) 2010-06-12

    prototype from the French, the software industry standards translated as "prototype", representing the initial shape of things, but also with models and model significance. Learning the Java object-oriented thinking, on the prototype of a number

  • Callback function theory 2010-08-10

    Callback function theory Statement CALLBACK Calling (calling) mechanisms have been in the times from the compilation of extensive use of: preparing a ready-made code, the caller can always jump to this section of code, starting address, then return t

  • php sort function sort.rsort.asort.arsort.ksort.krsort difference 2010-09-17

    1, quickly create an array of function range () Such as range () function can quickly create a number from 1 to 9 array: <? Php $ Numbers = range (1,9); echo $ numbers [1]; ?> Of course, the use of range (9,1) then created an array of numbers 9-1. M

  • Analysis of class member function pointer 2010-10-20

    With this line of code: typedef CPB_RETVAL (CPBprb_Prb:: * CPBprb_action) (CPBprb_Prb &, unsigned); Which is an enum type CPB_RETVAL, CPBprb_Prb is a class, CPBprb_action in the code definitions not found elsewhere. Because I do not know why this lin

  • Oracle date function and application (transfer) 2010-11-03

    Oracle date function and application (transfer) I believe many people have had the experience of some of the data statistics, such as the financial situation to statistics, may according to an annual, quarterly, monthly, or even every week to the res