Example 1:
Associar elemento com uma ação
Click on link below to run action
Action 1<script> events.context('example-1',{ action1:{ elements:'#element1_ex1', callback:function(arg){ alert('action 1'); } } }); </script>
Code organization
Version: 1.0 - Last Modified: 02/11/2016
Developed by Wallace Rio <[email protected]>
Inser the script on document
<script type="text/javascript" src="events.js"></script>
Associar elemento com uma ação
Click on link below to run action
Action 1<script> events.context('example-1',{ action1:{ elements:'#element1_ex1', callback:function(arg){ alert('action 1'); } } }); </script>
Associar elemento com uma ação
Click on link below to run action
<script> events.context('example-2',{ action2:{ elements:'[name="element1_ex2"]', callback:function(arg){ alert('action 1'); } } }); </script>
Associar multiplos elementos com uma ação
Click on link below to run action
Action 3<script> events.context('example-3',{ action3:{ elements:'#element1_ex3, [name="element2_ex3"]', callback:function(arg){ alert('action 3'); } } }); </script>
Associar elementos e evento com uma ação
Click on link below to run action
Action 4<script> events.context('example-4',{ action4:{ events:'click,mouseout', elements:'#element1_ex4, [name="element2_ex4"]', callback:function(arg){ alert('action 4'); } } }); </script>
Associar elementos HTML com uma ação.
Click on link below to run action
Action 5<a data-events="example-5:action5('5')">Action 5</a> <script> events.context('example-5',{ action5:{ callback:function(arg){ alert('action '+arg); } } }); </script>
Executar ação via Javascript.
Click on link below to run action
Action 6<script> events.context('example-6',{ action6:{ callback:function(arg){ alert('action '+arg); } } }); </script>
Execute the code:
events.context('example-6').action6('6');