in this piece of code, K is never mentioned on, so, what is it there for? I took this piece of code from a video lecture I saw. Why have k there? does it hold some kind of information in the given code?
var elems = [$ventfade, $venthoverm $spans];
$.each(elems, function(k,v){
if (v.data('currently') != 'showing'){
v.stop();
}
})
It’s the current index of the element. It’s not used in your example but the next parameter (
v) is, so the first parameter must be specified. If you had onlyfunction(v){ ...then v would have a different meaning.See also http://api.jquery.com/jQuery.each/