jquery随着屏幕尺寸的变化改变colorbox弹出尺寸

发布于 2024-12-11 05:21:25 字数 105 浏览 0 评论 0原文

我有两个 html div,其中第一个是第二个 div 的包装器,我一直在使用颜色框弹出窗口显示两个 div 的内容。我想在屏幕尺寸更改时更改内容和颜色框的大小(如果需要)。请帮我 。提前致谢 !

I have two html div where the first one is the wrapper of the second one , i have been showing the content of two divs with the colorbox popup . I want to change the size of the content and colorbox(if needed) when the screen size will be changed . Please help me . Thanks in advance !

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

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

发布评论

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

评论(1

远山浅 2024-12-18 05:21:25

当窗口尺寸改变时,这将调整颜色框的大小(相对于屏幕):

$(window).resize(function() {
    $.colorbox.resize({
        width:"75%", //or whatever dimensions you want
        height:"75%"
    });
});

This will resize the colorbox (relative to the screen) when the window dimensions change:

$(window).resize(function() {
    $.colorbox.resize({
        width:"75%", //or whatever dimensions you want
        height:"75%"
    });
});
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文