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?