Plugins

The plugins site is currently in development.

We've been looking to provide a higher-quality, spam-free experience at the plugins site for some time, and a major error on our part forced us to shut down the current site before we could put the new one in place. We are developing a new site, and you can follow along with its development on GitHub. For more information about this transition, including steps you can take as a plugin author to prepare, please read our post about what's going on.

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.

Downloads

Version Downloads Date Links
1.0-First release Notes


5
Your rating: None Average: 5 (3 votes)