I need someone to review a bug on my code pen

Hi,
I have this codepen: https://codepen.io/peles_cezar/pen/dJBdYp?editors=1111

If someone can help me to see why the jquery “click” event is no working and is firing on document load.

Thanks

The reason tempToogler fires on document load is because in the following line of code you are executing tempToogler instead of just referencing the function.

Instead of:

$("#toogler").click(tempToogler());

it should be:

$("#toogler").click(tempToogler);

The reason the click event does not work is because you are using pointer-events: none; in your “glass” class. This prevents the user from clicking on elements within this div and the div’s children elements. Was there a reason you put this line into your solution?