gpt4 book ai didi

jquery - ColorBox:使用链接到覆盖层中全尺寸图像的图像缩略图

转载 作者:行者123 更新时间:2023-12-01 05:57:21 25 4
gpt4 key购买 nike

我的 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com