Continue Nifty-GUI effects after triggering them

I’m trying to make a custom effect for Nifty Gui:

public class ContractEffect implements EffectImpl {

    private float size;
    public void activate(Nifty nifty, Element element, EffectProperties parameter) {
        size = element.getWidth();

    public void execute(Element element, float effectTime, Falloff falloff, NiftyRenderEngine r) {
        element.setWidth((int)(size - (size * effectTime)));

    public void deactivate() {


And use it with:

<registerEffect name="contractEffect" class="mygame.ContractEffect" />

The element have this:

                <onActive name="fade" start="#f" end="#8"/>
                <onHover name="fade" start="#8" end="#f"/>
                <onClick name="contractEffect" length="750"/>

I want it to start when I click an element and end it when the “length” time is ended but all my onClick effects are stopped when I stop pressing the element. I tried to comment the other two effects (they work as I want) but it have the same issue.

Have you tried it with neverStopRendering = true as an effect parameter?

Yes, I tried with it, but nothing.