Call function on mouse click or Enter keypress

程序名称:Call function on mouse click or Enter keypress

Call function on mouse click or Enter keypress 介绍

Typically useful on anchor elements for which following the link should
produce javascript functionality instead of the default action (following the
URL).

Function binds mouse click and enter keypress to a specified element, and
calls the specified function. The default action (e.g. following the href for
an anchor) is prevented.

Release 1.2+ supports binding to more than one element, because the callback
function is aware of the target of the click / enter keypress.

Usage:

$.clickOrEnter(yourElement,yourFunction);

e.g.

$.clickOrEnter('a',popup);

This essentially replaces the style of

<a href="javascript:function();">Foo</a> <a href="foo.html" onclick="function();" onkeypress="function();">Bar</a>

which are inaccessible / obtrusive.

Call function on mouse click or Enter keypress 官网

http://plugins.jquery.com/project/clickOrEnter

相关编程语言

多功能下拉选择插件 SelectPage 简洁而强大的下拉分...
AutoComplete 是一个 jQuery Mobile 的插件,用于实...
Combogrid 是一个jQuery插件用于为输入框添加高级自...
Autobox2这个jQuery插件,可以用于创建类似于Facebo...
Link Scraper TextBox 是一个文本框的扩展插件,当你...
Awesomplete 超小超好用的超漂亮的 autocomplete 框...