- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我的 colorbox 工作正常。
是否有一种方法可以从 colorbox 内获取全尺寸图像(800px x 800px)并将其用作 colorbox anchor 中的小拇指(100px x 100px),就像但让 colorbox 覆盖显示全尺寸?
<a href="pathToImage/image.jpg" class="colorbox"><img src="pathToImage/image.jpg" /></a>
href = 100 像素 x 100 像素拇指img = 全尺寸
或者,这最好由 timthumb 之类的东西来完成吗?
仅供引用...我在 WordPress 插件的管理区域中使用 colorbox。
[更新]因为我是在 Wordpress 中执行此操作,据我所知,更改图像大小内嵌广告会在页面加载时间上产生不必要的开销。
这是我正在使用的jquery:add_action( 'admin_head', 'do_colorbox_script' );
函数 wlmm_do_colorbox_script() {
$max_width = ''; $max_height = '';
$width = ''; $height = '';
$inner_width = ''; $inner_height = '';
$opacity = '0.9';
$img_error = 'Sorry this image not currently available.';
// Colorbox settings
echo '
<script>
jQuery(document).ready(function () {
jQuery("a.help").colorbox({
maxWidth:"'.$max_width.'",
maxHeight:"'.$max_height.'",
Width:"'.$width.'",
Height:"'.$height.'",
innerWidth:"'.$inner_width.'",
innerHeight:"'.$innerHeight.'",
imgError:"'.$img_error.'",
opacity:'.$opacity.' });
});
</script>';
}
最佳答案
试试这个:
<a href="pathToImage/image.jpg" class="colorbox"><img width="100" height="100" src="pathToImage/image.jpg" /></a>
但是,除非您还可以提供用于调用它的 colorbox jQuery,否则很难给出完整的答案。
关于jquery - ColorBox:使用链接到覆盖层中全尺寸图像的图像缩略图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14268502/
我有一个具有可变数量子元素的固定大小的 div。我不知道 children 的大小。目标是缩小它们以适合父级。 例子: .parent { width: 100px; height: 100p
我是一名优秀的程序员,十分优秀!