Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Summary #10

Closed
cssmagic opened this issue Dec 3, 2014 · 0 comments
Closed

Summary #10

cssmagic opened this issue Dec 3, 2014 · 0 comments
Labels

Comments

@cssmagic
Copy link
Owner

cssmagic commented Dec 3, 2014

Summary

An easy and lazy solution for click-event-binding.

Step 1

Define some actions:

action.add({
    'my-action': function () {
        //do something...
    },
    ...
})

Step 2

Create an element like this:

<button data-action="my-action">btn</button>

<!-- or -->
<a href="#" data-action="my-action">link</a>

<!-- or -->
<a href="#my-action" data-action>link</a>

Step 3

You've done everything.

Clicking the element will trigger the action you defined.

@cssmagic cssmagic changed the title 简要介绍 简介 Dec 3, 2014
@cssmagic cssmagic changed the title 简介 简介 / Summary Dec 3, 2014
@cssmagic cssmagic added the doc label Dec 3, 2014
@cssmagic cssmagic changed the title 简介 / Summary Summary / 简介 Dec 3, 2014
@cssmagic cssmagic changed the title Summary / 简介 Summary Dec 4, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant