var ali = $('.zhucai li'); ali.each(function (index) { $(this).mouseover(function () { slide(index); }) });