2013-03-11 59 views
1

我正在尝试将Highslide与我的Wordpress网站集成,无需插件。我已经改变了hs.graphicsDir变量:Highslide不会在Wordpress上展开图像

graphicsDir : 'http://hyohanpark.com/wp-content/themes/Noir/highslide/graphics/' 

我的标签内的代码也阅读:

<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/highslide/highslide-with-gallery.js"></script> 
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/highslide/highslide.config.js" charset="utf-8"></script> 
<link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/highslide/highslide.css" /> 
<!--[if lt IE 7]> 
<link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/highslide/highslide-ie6.css" /> 
<![endif]--> 

下面是代码的外观,当我显示使用打开的图像像highslide:

<div class="highslide-gallery"> 
<ul> 
<li> 
<a href="http://hyohanpark.com/wp-content/uploads/2013/03/IMG_0042.png" class="highslide" 
     onclick="return hs.expand(this, config1)"> 
    <img src="http://hyohanpark.com/wp-content/uploads/2013/03/IMG_0042.png" width="230" height="154" alt=""/> 
</a> 
</li> 
</ul> 
<div style="clear:both"></div></div> 

一切似乎都在工作;但是,一旦您点击图片而不是展开图片,它就会打开图片的网址,而不是像图片的常规链接一样。

任何有助于让图像正常展开的赞赏。

谢谢!

回答

1

我怀疑您的图片的onclick与您的highslide.config.js文件的内容不一致。

当你使用config1onclick你还需要一个相应的配置对象在highslide.config.js文件:

var config1 = { 
    //configurations for the images 
}; 

配置对象可以是空的,但它通常会包含画廊的设置。

+0

谢谢! var config1缺少某种方式,所以我添加了该部分。它仍然不起作用,但我最终转到了wordpress中图像的高级设置,并将“highslide”添加到“Link Rel”框中。这使它工作! – user2155861 2013-03-12 02:29:21