ColorBox:使用图像滑块链接到叠加中的全尺寸图像

时间:2013-01-10 22:33:06

标签: jquery colorbox

我的彩盒工作正常。

是否有一种方法可以从彩色盒中取出一个完整尺寸的图像(800px×800px),并将其用作彩色盒锚中的小拇指(100px×100px),但是彩色盒叠加显示全尺寸?

<a href="pathToImage/image.jpg" class="colorbox"><img src="pathToImage/image.jpg" /></a>

href = 100px x 100px拇指 img =完整尺寸

或者,这最好用timthumb这样的东西来完成吗?

fyi ...我在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>';

}

1 个答案:

答案 0 :(得分:0)

试试这个:

<a href="pathToImage/image.jpg" class="colorbox"><img width="100" height="100" src="pathToImage/image.jpg" /></a>

但是,除非您还可以提供用于调用它的colorbox jQuery,否则很难给出完整的答案。