0

我正在使用 colorbox-script 来制作灯箱图像。现在我想将语句“y 的图像 x”更改为“x/y”,但它不起作用。

我正在使用这个脚本:

<script type="text/javascript" charset="utf-8">
  $(document).ready(function(){
    $('a').colorbox({current: "{current}/{total}"});
  });
</script>   

这是 HTML 输出:

<a class='colorbox cboxElement'  title="Roll Up Display Start<br /><span style='font-weight:normal; font-size: 9px'>Roll Up Display Start</span>"  href='assets/images/disroll_start.jpg' ><img style="float: right;" title="Roll Up Display Start" src="assets/components/directresize/cache/dr_disroll_start_w200_h437.jpg" alt="Roll Up Display Start"   /></a>

我也想去掉这个部分"<br /><span style='font-weight:normal; font-size: 9px'>Roll Up Display Start</span>",但我不知道在哪里改变这个......

任何人的任何提示?

提前谢谢!

4

2 回答 2

1
$('a').colorbox({current: "{current}/{total}"});

这是正确的。如果它不适合你,那么你已经在你的帖子中留下了相关信息。

您的 title 属性中的标记与颜色框没有任何关系。

于 2012-08-15T17:43:59.840 回答
0

您需要使用插件的 CSS 文件来处理 ColorBox Title 字符串的样式,而不是通过在标记中嵌入 CSS 规则。

研究插件使用的 CSS 文件,因为作者 (JackM) 在这方面做得非常出色。特别注意选择器#cboxTitle上的规则;这应该会让你成功完成一半以上。

KJM

于 2012-08-15T18:55:10.387 回答