首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Slimbox与Virtuemart 2、Joomla 2.5集成

Slimbox与Virtuemart 2、Joomla 2.5集成
EN

Stack Overflow用户
提问于 2012-05-07 16:53:29
回答 1查看 2.2K关注 0票数 0

我正在尝试将默认的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

以下是我的尝试:

代码语言:javascript
运行
复制
        //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]);
        ?>

但是它还是不能工作,我想知道出了什么问题?

参考文献

EN

回答 1

Stack Overflow用户

发布于 2012-05-08 22:30:03

您没有将slimbox类应用于图像引用,而是将其应用于图像的容器,不是吗?在我看来,您需要直接处理图像文件url。

代码语言:javascript
运行
复制
// 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>
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/10479240

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档