может кто-нибудь сказать мне, в чем разница между назначением обработчиков событий с помощью bind ():
$(function () {
$('someElement')
.bind('mouseover', function (e) {
$(this).css({
//change color
});
})
.bind('mouseout', function (e) {
$(this).css({
//return to previous state
});
})
.bind('click', function (e) {
$(this).css({
//do smth.
});
})
});
используя each () для одной и той же задачи:
$('someElement').each(function () {
$(this).mouseover(function () {
$(this).css({/*change color*/ })
.mouseout(function () {
$(this).css({/*return to previous state*/ });
});
});
});