Hi dev!πββοΈ
During my work i used an event looks very interessant: is a trigger() event.
The trigger() method triggers the specified event more times:
π§βπ»
<button type="button" class="click"> CLICK </button>
<div class="container">
</div>
$('.button').click(function(){
$(document).trigger('nameOfMyTriggerEvent')
})
$(document).on('nameOfMyTriggerEvent', function(){
$('.container').hide();
})
It's easy and very usefull if you need to trigger an event more times.
Hope it helpfully!
βοΈ
Top comments (0)