我需要帮助来禁用 Shadowbox 调整大小
这个覆盖似乎是唯一可以在我的学校古怪模板中工作的覆盖插件......但问题是,当调整浏览器大小时,阴影框也会调整大小,从而剪切其中的内容。我想要它,以便固定框统计信息,如果浏览器确实变小,浏览器将有滚动条。
我知道之前已经修改过,但我不知道从哪里开始。我什至找不到 .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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
嘿,我遇到了完全相同的问题 - 我发现您可以通过将其放入 Shadowbox.css 文件中来强制其达到您想要的高度:
并且在您的 HTML 标记中,确保在 rel 属性中定义高度和宽度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:
And in your HTML markup, make sure you define the height and width in the rel attribute of the a tag:
I don't know where to start either with the JavaScript file - CSS it is.
在
shadowbox.js
脚本的最后几行中查找K.onWindowResize
函数,并将其修改如下:Look for the
K.onWindowResize
function in the last lines of theshadowbox.js
script and modify it as follows:假设您使用的是 http://www.shadowbox-js.com/ 中找到的代码,如果您希望图像始终具有一定的大小(在本例中假设高度为 600px),则将以下内容添加到 CSS 中即可:
如果没有静态高度,您可以强制它们这样做,这比我在喝咖啡休息时间想出的要困难得多。
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:
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.
只需将其放入 init 中即可
,然后填充永远不会变为负数,因此不会调整大小。
Just put this in the init
Then the pading never gets to negative and so does't resize.