Handle It

Trigger the link events and check your console for some sweet activity

HTML

Handler 1 - Click

<a class="handler" href="#heythere1" data-event="click" data-trigger="trigger1">
    Handler 1 - Click
</a>

Handler 2 - Click + Mouseover - Return false on click

<a class="handler" href="#heythere2" data-handler='[
    {
        "event": "click",
        "trigger": "trigger2",
        "return": "false"
    },
    {
        "event": "mouseover",
        "trigger": "trigger3"
    }
]' data-return="false">
    Handler 2 - Click + Mouseover - Return false on click
</a>

Handler 3 - Handler on parent - Target links

<p class="handler" data-event="click" data-trigger="trigger4" data-target="a">
    <a href="#heythere3">
        Handler 3 - Handler on parent - Target links
    </a>
</p>

JS

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="../handleit/handleit.min.js"></script>
<script>
$(function() {
    $('body').on('trigger1', function(event, handler_event) {
        console.log('trigger1 - event', event);
        console.log('trigger1 - handler_event', handler_event);
    });

    $('.handler').on('trigger2', function(event, handler_event) {
        console.log('trigger2 - event', event);
        console.log('trigger2 - handler_event', handler_event);
    });

    $('.handler').on('trigger3', function(event, handler_event) {
        console.log('trigger3 - event', event);
        console.log('trigger3 - handler_event', handler_event);
    });

    $('.handler').on('trigger4', function(event, handler_event) {
        console.log('trigger4 - event', event);
        console.log('trigger4 - handler_event', handler_event);
    });
});
</script>