标签:for before tab scrollto this layout 方向 rto scroll
var beforeTop = $("#table_layout").scrollTop();
var beforeLeft = $("#table_layout").scrollTop();
$("#table_layout").scroll(function () {
var afterTop = $(this).scrollTop();
var afterLeft = $(this).scrollLeft();
if (beforeTop > afterTop) {
$("#table_layout").after("上");
beforeTop = afterTop;
}
else if (beforeTop < afterTop) {
$("#table_layout").after("下");
beforeTop = afterTop;
};
if (beforeLeft > afterLeft) {
$("#table_layout").after("左");
beforeLeft = afterLeft;
}
else if (beforeLeft < afterLeft) {
$("#table_layout").after("右");
beforeLeft = afterLeft;
}
});
标签:for before tab scrollto this layout 方向 rto scroll
原文地址:http://www.cnblogs.com/artjs/p/6291767.html