对于标准事件,事件处理函数是预定义的。
见事件处理函数要求。
清单8说明这些事件处理函数的结构。
Listing 8 demonstrates the structure of these event-handlers.
事件由名称标识并定义相应的事件处理函数。
An event is identified by a name and the handler of the event and is defined along with the event.
清单6显示的是小部件样例的事件处理函数和回调函数。
Listing 6 shows the event handlers and the callback function of the sample widget.
在事件处理函数中可以使用以下语法调用动作
Actions can be invoked inside event-handlers using the following syntax
事件处理函数将被阻塞直到UI线程能够处理它。
The event handler will be blocked until the UI thread is able to process it.
然后可以使用Dojo为按钮点击关联一个事件处理函数。
You then use Dojo to associate an event handler for when the button is clicked.
注意,这些元素上设置了与鼠标操作相关的三个事件处理函数。
Notice that these elements have three different mouse action-related event handlers.
在刚启动时调用这个事件处理函数,将初始屏幕内容设置为可见。
This event handler is called at the very beginning so that the initial screen contents can be set to be viewed.
然后就会提示我们在我们的后台代码类中该使用的事件处理函数。
Which will then prompt us for the event handler in our code-behind class to use?
现在我们已经准备好学习更多的事件处理函数的信息了。
事件处理函数名必须与定义文件中的名称匹配,而此名称由用户定义。
The name of the event handler must match the name declared in the definition file in which the name is user definable during definition time.
例如,onmousemove等鼠标事件处理函数常常会产生大量调用。
Hover event handlers such as onmousemove often produce a large number of events.
这可能包括事件关联函数、事件处理函数、错误方法和计时器方法。
This might include the event hooks, the event handler, the error methods, and the timer methods.
这个事件处理函数启动一个新的服务器,通过在它上面执行一系列命令来配置它。
The event handler starts a new server and configures it by executing a sequence of commands on it.
事件处理函数接受一个ElapsedEventArgs类型的参数。
The event handler receives an argument of type ElapsedEventArgs.
要构造示例概要清单,从事件处理函数中调用queryandupdate函数。
To build the example overview list, the queryAndUpdate function is called from the event handler functions.
在jQuery中使用事件处理函数时,上下文变量是指触发事件的元素。
When using event handlers in jQuery, the context variable refers to the element that fired the event.
然后把这个事件处理函数分配给onreadystatechange属性。
This handler function was then assigned to the onreadystatechange property.
清单5给出一个扩展openidresolver的默认实现的事件处理函数。
Listing 5 shows a handler that extends the default implementation of OpenIDResolver.
然后VS就会自动地在我们的后台代码类文件中创建一个占位的事件处理函数实现。
VS will then automatically create a stub event handler implementation in our code-behind class file. We can use this event handler to update the Button's content with a new message when it is clicked.
用户的页面行为触发事件,事件处理函数响应该页面行为,于是页面交互就产生了。
When the user takes action he causes an event. When your script makes the page react to this event, interactivity is born.
事件处理函数停止表单提交,并使用在dojo.xhrPost 函数中使用Ajax。
The handler stops form submission and uses Ajax instead through the dojo.xhrPost function.
第一段包含初始化应用程序的事件处理函数(onload)和数据库初始化,如清单3所示。
The first block contains the event handler to initialize the application (onload) and the initialization of the database, as shown in Listing 3.
要给我们的按钮加行为的话,我们可以给它加一个“Click ”事件处理函数。
To add behavior to our button we can add a "Click" event handler to it. We can do this in source view by typing the event name.
这个事件处理函数会接收到一个事件对象,可以通过它来阻止(浏览器)默认的行为。
The event handler is passed an event object that you can use to prevent default behaviour.
如果把在绑定时传递的处理函数作为第二个参数,则只有这个特定的事件处理函数会被删除。
If the function that was passed to bind is provided as the second argument, only that specific event handler is removed.
当单击这些菜单文本项时,对应的onclick事件处理函数让对应的屏幕出现在浏览器窗口中。
When one of these menu text items is clicked, then the corresponding onclick event handler makes the corresponding screen appear in the browser window.
通过用“属性”窗口定义消息和事件处理函数,可以自动更新消息调度表(或消息映射)和类的头文件。
By using the Properties window to define message - and event-handling functions, you can automatically update the message-dispatch table (or message map) and your class header file.
应用推荐