0
在下面的示例代码中,使用回调函数作为scrollTop()的参数。jQuery的scrollTop()接受回调函数吗?
什么是参数值i和回调诉?
jQuery(document).ready(function() {
var is_dragging = false;
$('ul').disableSelection().sortable({
axis: 'y',
start: function() { is_dragging = true },
stop: function() { is_dragging = false }
}).mousemove(function(e) {
if(is_dragging) {
// **** What are parameters' values i and v of the callback? *****
$('ul').scrollTop(function(i, v) {
var h = $('ul').height();
var y = e.clientY - h/2;
return v + y * 0.1;
});
}
});
});
的示例代码是从后 Scrolling a sortable/dragable item's parent container when its border is reached
感谢
但功能真的叫,请看到我更新的代码中,V和I是输出到控制台。 http://jsfiddle.net/xjrLN/131/ – thermostat
@thermostat我意识到这太晚了,看到我的编辑。 –