Earlier I have covered few articles related to event binding using MooTools. Here you can see the basic things which we need to know for MooTools.
Upto now I have explained about assigning an events. When you assign event then it will remain assigned untill you remove the events.
For example, If I have assigned click event then it will executed every time you click on that element. This is the comman thing. But what if you want to click only once?
Yes this is what today’s article is about. I will show you the trick with which you can assign event but that only once using MooTools.
Make sure that you have included MooTools More to make this happen.
Normally we can assign click events using the event name “click“, but when you want to make it only once then that event should looks like “click:once“.
I have prepared live demo for this also but before this have a look at this code block for the same.
Have a look at live demo for this trick also.
Avinash Zala currently working at a leading web development company as a Sr. PHP Web Developer. He is the founder of the Xpert Developer. He has completed B.E. in Information Technology. Born and brought up in Ahmedabad. He loves to code and coding is all about passion for him. Follow him on twitter at Avinash Zala & Xpert Developer.
View all posts by: Avinash