Skip to content

Summary #10

Closed
Closed

Description

@cssmagic

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.

Activity

  1. changed the title [-]简要介绍[/-] [+]简介[/+] on Dec 3, 2014
  2. changed the title [-]简介[/-] [+]简介 / Summary[/+] on Dec 3, 2014
  3. changed the title [-]简介 / Summary[/-] [+]Summary / 简介[/+] on Dec 3, 2014
  4. changed the title [-]Summary / 简介[/-] [+]Summary[/+] on Dec 4, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions