How do I convert several anonymous jquery functions into a single named function?
<p>Is it possible to convert the following four anonymous jquery functions into one function that gets a parameter passed?</p>

<p>this is what I have...</p>

<pre><code>    dropZone.addEventListener("dragenter", this.dragEnter, false);
    dropZone.addEventListener("dragover", this.dragOver, false);
    dropZone.addEventListener("dragleave", this.dragLeave, false);
    dropZone.addEventListener("drop", this.dragDrop, false);
</code></pre>

<p>...</p>

<pre><code>this.dragOver = function(ev) {
    ev.stopPropagation();
    ev.preventDefault();
    this.className = "dragover";
}

this.dragLeave = function(ev) {
    ev.stopPropagation();
    ev.preventDefault();
    this.className = "dragleave";
}

this.dragEnter = function(ev) {
    ev.stopPropagation();
    ev.preventDefault();
    this.className = "dragenter";
}

this.dragDrop = function(ev) {
    ev.stopPropagation();
    ev.preventDefault();
    this.className = "dragdrop";
}
</code></pre>

<p>I'm looking for something functionally similar to...</p>

<pre><code>    dropZone.addEventListener("dragenter", dropEvent(this,"dragenter"), false);
    dropZone.addEventListener("dragover",  dropEvent(this,"dragOver"), false);
    dropZone.addEventListener("dragleave", dropEvent(this,"dragLeave"), false);
    dropZone.addEventListener("drop",      dropEvent(this,"dragDrop"), false);
</code></pre>

<p>...</p>

<pre><code>function dragEvent(ev, label) {
    ev.stopPropagation();
    ev.preventDefault();
    this.className = label;
}
</code></pre>
