动态创建的flowplayer可滚动addItem滚动出容器

发布于 2024-12-09 14:12:13 字数 537 浏览 8 评论 0原文

我正在创建一个水平可滚动列表,它也是可编辑的。该列表的容器的大小是根据浏览器可见区域的宽度动态变化的。当我有一个填满屏幕的项目列表并添加一个新项目时,容器会滚动经过新添加的元素,到达空白屏幕。如果我使用“上一页”按钮向后滚动,我确实会看到它。我已附加用于动态添加新项目的代码。

我尝试使用 .move 和 .seekTo 函数到达正确的位置,但我的“上一个”按钮被随机禁用,因此我无法向后滚动。

有任何人指点吗?

var speed = 200;
var parent = $("#main-container").data("scrollable");

parent.end(speed);    

var clone = $("#thumbnail-clone").clone(true, true);
var input = clone.find(".text-input");

clone.attr("id", newid);

parent.addItem(clone);

input.show();
clone.show();
input.focus();

I am creating a horizontal scrollable list which is also editable. The size of the container of this list is dynamic based on the width of the visible area of the browser. When I have a list of items which has filled up the screen, and I add a new Item, the container scrolls way past the newly added element, to a blank screen. If I scroll back using the "prev" button, I do see it. I've attached code which is used to dynamically add the new item.

I tried to use the .move and .seekTo functions to get to the correct location, but my "prev" button gets randomly disabled so I can't scroll back.

Any pointers from anyone?

var speed = 200;
var parent = $("#main-container").data("scrollable");

parent.end(speed);    

var clone = $("#thumbnail-clone").clone(true, true);
var input = clone.find(".text-input");

clone.attr("id", newid);

parent.addItem(clone);

input.show();
clone.show();
input.focus();

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文