我需要帮助来禁用 Shadowbox 调整大小

发布于 2024-09-01 21:19:05 字数 172 浏览 4 评论 0原文

这个覆盖似乎是唯一可以在我的学校古怪模板中工作的覆盖插件......但问题是,当调整浏览器大小时,阴影框也会调整大小,从而剪切其中的内容。我想要它,以便固定框统计信息,如果浏览器确实变小,浏览器将有滚动条。

我知道之前已经修改过,但我不知道从哪里开始。我什至找不到 .js 文件的未缩小版本。

谢谢

This overlay seems to be the only overlay plugin that works within my schools wonky template... but the problem is that when the browser is resized the shadowbox resizes too, clipping the contents inside. I want it so the box stats fixed and if the browser does get smaller the browser will have scrollbars.

I know it's been modified before, but i dont know where to start. I cant even find an unminified version of the .js file.

Thanks

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

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

发布评论

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

评论(4

糖粟与秋泊 2024-09-08 21:19:05

嘿,我遇到了完全相同的问题 - 我发现您可以通过将其放入 Shadowbox.css 文件中来强制其达到您想要的高度:

#sb-wrapper { height:560px !important; }
#sb-wrapper-inner { height:560px !important; }

并且在您的 HTML 标记中,确保在 rel 属性中定义高度和宽度a 标签:

<a href="somelink.php" rel="shadowbox;width=600;height=560;">Your Link</a>

我不知道从哪里开始使用 JavaScript 文件 - CSS 文件。

Hey I was having this exact same issue - I found that you can force it to the height you want by putting this in the shadowbox.css file:

#sb-wrapper { height:560px !important; }
#sb-wrapper-inner { height:560px !important; }

And in your HTML markup, make sure you define the height and width in the rel attribute of the a tag:

<a href="somelink.php" rel="shadowbox;width=600;height=560;">Your Link</a>

I don't know where to start either with the JavaScript file - CSS it is.

失去的东西太少 2024-09-08 21:19:05

shadowbox.js 脚本的最后几行中查找 K.onWindowResize 函数,并将其修改如下:

K.onWindowResize=function(){
if(!doWindowResize){return}setSize();
var player=S.player, dims=setDimensions(player.height,player.width);

//edited by gabriel esquivel 11/15/10
//adjustWidth(dims.width,dims.left);
//adjustHeight(dims.innerHeight,dims.top);
animate(wrapper,"top",dims.top,0);
animate(wrapper,"left",dims.left,0);

if(player.onWindowResize){player.onWindowResize()}};

Look for the K.onWindowResize function in the last lines of the shadowbox.js script and modify it as follows:

K.onWindowResize=function(){
if(!doWindowResize){return}setSize();
var player=S.player, dims=setDimensions(player.height,player.width);

//edited by gabriel esquivel 11/15/10
//adjustWidth(dims.width,dims.left);
//adjustHeight(dims.innerHeight,dims.top);
animate(wrapper,"top",dims.top,0);
animate(wrapper,"left",dims.left,0);

if(player.onWindowResize){player.onWindowResize()}};
久而酒知 2024-09-08 21:19:05

假设您使用的是 http://www.shadowbox-js.com/ 中找到的代码,如果您希望图像始终具有一定的大小(在本例中假设高度为 600px),则将以下内容添加到 CSS 中即可:

#sb-wrapper-inner { height:600px !important; }

如果没有静态高度,您可以强制它们这样做,这比我在喝咖啡休息时间想出的要困难得多。

Assuming you're using the code found at http://www.shadowbox-js.com/, if you want the images to always be of a certain size (let's say a height of 600px for the purpose of this example), adding the following to your CSS should do it:

#sb-wrapper-inner { height:600px !important; }

If there's not a static height you can force them to, it's more difficult than I can figure out on my coffee break.

榆西 2024-09-08 21:19:05

只需将其放入 init 中即可

Shadowbox.init({
    viewportPadding:-1000
});

,然后填充永远不会变为负数,因此不会调整大小。

Just put this in the init

Shadowbox.init({
    viewportPadding:-1000
});

Then the pading never gets to negative and so does't resize.

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