I am making a sliding menu using addEventListener, through which I am showing the hidden part of the menu when an item is clicked. However, when the item is being clicked again, the process of sliding starts over again. Is there any way to prevent the listener from executing the code which is being executed at the moment?

```
    var menuItemHidden = document.getElementById("hidden");

    // Unrolling

    function unroll() {

        var height = 0;

        var unroll1 = function() {

            height = height + 1;
            menuItem.style.height = height + "px";

            if (height == 100 ) {

                clearInterval(i);

            }

        };
        d.unrolling = "rolling";
        var i = window.setInterval(unroll1,1);

    }

    var menuItem = document.getElementsByTagName("li");

    // I would like to prevent this code from being executed when it is currently
    // running, is there any way to achieve this?

    menuItem[2].addEventListener("click",unroll,true);

```