如何让 slimbox 2 自动调整大小以适合屏幕?
根据 Slimbox2 文档,不支持此功能。但我想知道是否有人遇到过使这项工作有效的技巧。
我主要担心的是我的一些图像相当长,并且在低分辨率下 LightBox2 会给用户带来恼人的体验。
According to the Slimbox2 documentation this function isn't supported. But I was wondering if anyone had encountered any tricks to make this work.
The main concern I have is that some of my images are fairly lengthy, and at low resolution LightBox2 would create an annoying experience for the user.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我最近开始在我的网站 (http://www.trips.elusien.co.uk) 上使用 slimbox2,发现它可以从一些修改中受益:
“幻灯片大小调整”:这使得幻灯片的大小常数,而不是取决于图像的大小(通过指定像素大小),或者您可以使用百分比来使幻灯片在幻灯片中变大或变小。您可以使用 2 个新选项来指定:
使幻灯片能够自动翻转,而不是手动翻转。您可以使用新选项来指定它:
从幻灯片中下载幻灯片。
第一个和最后一个功能无法使用 slimbox2 的原始版本来完成,因为在该版本中图像显示为背景图像,而不是使用“IMG”标签。
我已将 Javascript 和 CSS 文件放在我的网站上。如果您想尝试它们,请访问我的网站并单击“slimbox 示例”链接,您可以从此处下载它们。要查看使用 slimbox2 的简洁方法,请单击主页上的“photoSLide Show”链接。
问候尼尔
I recently started to use slimbox2 on my website (http://www.trips.elusien.co.uk) and found that it could benefit from a few modifications:
"slide resize": this makes the size of the slideshow constant, rather than depending on the size of the image (by specifying a pixel size), or you can use a percentage to make the slides larger or smaller in the slideshow. You specify this using 2 new options:
enable the slides to be flipped automatically, rather than manually. You specify this using a new option:
download the slides from the slideshow.
The first and last features cannot be done with the origal version of slimbox2 since in that version the image is displayed as a BACKGROUND image, rather than using the "IMG" tag.
I have put the Javascript and CSS files on my website. If you want to try them go to my website and click on the "slimbox examples" link, you can download them from here. To see a neat way of using slimbox2 click in the "photoSLide Show" link on the home-page.
Regards Neil
检查我的代码很容易修复。
找到并替换 slimbox2.js 文件中的三行:
替换为:
im 业余的 javascript 但我认为它工作得很好。我也让它在 IE8 上工作。您只需要插入:
its easy to fix check my code.
find and replace the three lines in slimbox2.js file:
with:
im amateur at javascript but i think its working great. I made it work with IE8 also. You only need to insert:
加载图像后,执行以下操作:
$('#lbImage').css('background-size', 'contain');
after loading the image, do this:
$('#lbImage').css('background-size', 'contain');