我正在尝试将默认的lightbox 'modal‘替换为'slimbox',因为'modal’没有导航箭头。
Demo of slimbox with navigations
Demo of modal without navigations
我正在使用这些路径修改slimbox的调用
templatename/html/com_virtuemart/productdetails/default.php components/com_virtuemart/productdetails/default.php
Joomla v2.5 Virtuemart 2.0.6 Slimbox2
以下是我的尝试:
//Enable Slimbox2 plugin
$front = JURI::root(true).'/components/com_virtuemart/assets/';
$document = JFactory::getDocument();
$document->addStyleSheet($front.'js/slimbox/slimbox.css');
$document->addScript($front.'js/slimbox/slimbox2.js');
$js = 'jQuery(document).ready(function($) { $("a.lightbox").slimbox(); });';
$document->addScriptDeclaration($js);
//output thumbnail
echo $this->product->images[0]->displayMediaThumb('class="product-image"',true,'class="lightbox" rel="lightbox"'.$this->product->virtuemart_product_id.'"',true,true);
//unset first image not to be show amont additional ones
unset ($this->product->images[0]);
?>
但是它还是不能工作,我想知道出了什么问题?
参考文献
发布于 2012-05-08 22:30:03
您没有将slimbox类应用于图像引用,而是将其应用于图像的容器,不是吗?在我看来,您需要直接处理图像文件url。
// get the file_url of the first image
$imgPath = $this->product->images[0]->file_url;
// output the image
<a class="slimbox" href="<?php echo $imgPath; ?>">
<img src="<?php echo $imgPath; ?>" alt="" />
</a>
https://stackoverflow.com/questions/10479240
复制相似问题