如何为Miva快速查看按钮添加Colorbox弹出窗口

时间:2012-10-17 17:57:17

标签: jquery colorbox miva

我正在尝试复制Nextopia的Quick View弹出窗口。他们正在使用Colorbox。我们网站上的一个示例位于http://www.hatsinthebelfry.com/category/womens-hats.html

这是当前按钮的Miva代码(测试页面:http://www.hatsinthebelfry.com/category/NEXtest.html

当前按钮:

<input type="button" value="Quick View" onClick="divwin=dhtmlwindow.open('divbox&mvt:product:id;', 'div', 'somediv&mvt:product:id;', '&mvt:global:JSProdName;', 'width=600px,height=560px,top=20px,scrolling=1, center=1'); return false" style="cursor:hand;" class="nxt_moreinfo">

这是我从Jack Moore(Colorbox的开发者)获得的代码,但这是打开一个html页面。我需要打开一个div。

<button onclick='$.colorbox({href:"example.html"}); return false;'></button>

有谁能告诉我如何在colorbox语法中正确调用miva代码?

2 个答案:

答案 0 :(得分:0)

据我了解你提出这个问题:

$.colorbox({ href: '#inline_content', inline:true });

和html:

<div style='display:none'>
     <div id='inline_content'>test</div>
</div>

答案 1 :(得分:0)

$.colorbox({ 
rel:'mycontent',
inline:true,
href: function(){var url = $(this).attr('href'); return url;}
});

<a rel="mycontent" href="do-something.php?productid=somevalue">Do Something</a>

以上允许使用单个颜色框参考。

相关问题