Hello,
I need to detect when a condition has been triggered in order to run some extra process.
I tried to do something like this:
$('...').conditionize({
ifTrue: [
// ...
function ($s) { $s.trigger('my-event-name'); }
],
ifFalse: [
// ...
function ($s) { $s.trigger('my-event-name'); }
]
});
But unfortunately, the event is fired as many times as we have elements related to the condition.
(If I have 10 elements using the same data-condition, the event is triggered 10 times, every time the condition has changed)
It will be very useful if conditionize2 could natively fire some events that we can listen when conditions are triggered (eg conditionize.before / conditionize.after)
Hello,
I need to detect when a condition has been triggered in order to run some extra process.
I tried to do something like this:
But unfortunately, the event is fired as many times as we have elements related to the condition.
(If I have 10 elements using the same
data-condition, the event is triggered 10 times, every time the condition has changed)It will be very useful if conditionize2 could natively fire some events that we can listen when conditions are triggered (eg
conditionize.before/conditionize.after)