Spotify 标准化曲目列表设置滚动条出现前的高度

发布于 2025-01-05 07:48:13 字数 670 浏览 3 评论 0原文

使用如下代码片段:

sp = getSpotifyApi(1);
var models = sp.require("sp://import/scripts/api/models");
var tpl = new models.Playlist();
var tempList = new views.List(tpl);
$(tempList.node).appendTo(document.getElementById("tracks"));

这篇文章,如何更改使用提供的 Spotify 模型显示曲目的默认

我希望能够对其进行设置,以便在元素的大小为 300px 而不是默认的 600px 时出现滚动条。

看看这个API,没有'这似乎是一个简单的方法。

Using a code snippet like:

sp = getSpotifyApi(1);
var models = sp.require("sp://import/scripts/api/models");
var tpl = new models.Playlist();
var tempList = new views.List(tpl);
$(tempList.node).appendTo(document.getElementById("tracks"));

As described in this post, how can I change the default <div> size that the tracks are displayed in using the supplied Spotify model?

I want to be able to set it so that a scrollbar will appear if the size of the element is say 300px instead of the default 600px.

Looking at this API, there doesn't appear to be a simple way to do this.

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

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

发布评论

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

评论(1

单调的奢华 2025-01-12 07:48:13

您可以使用 css 设置 max-height 属性。

.sp-list {
    max-height: 300px;
}

You can set the max-height property with css.

.sp-list {
    max-height: 300px;
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文