如何在 jQuery 中滑动 DIV?

发布于 2025-01-03 23:17:57 字数 131 浏览 1 评论 0原文

我正在 JQuery 中寻找一些东西来允许大 div 的同步滑动。

div 宽度可以通过其他 jquery 函数增加运行时间。

我想水平滚动 div,每秒滑动 50px....可以同步吗?

谢谢大家

I'm looking for something in JQuery to allow a synchronized slide of a big div.

The div width can be increased runtime by other jquery functions.

I want to scroll the div horizontally, sliding 50px every second....is it possible to do this synch?

thank you all

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

信愁 2025-01-10 23:17:57

像这样的东西吗?

(function slide() {
  $('#foo').animate(
    // move 50px to the left
    {left: '-=50px'},

    // in one second
    1000,

    // without easing 
    'linear',

    // recursive call on completion
    slide
  );
}());

Something like this?

(function slide() {
  $('#foo').animate(
    // move 50px to the left
    {left: '-=50px'},

    // in one second
    1000,

    // without easing 
    'linear',

    // recursive call on completion
    slide
  );
}());
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文