【发布时间】:2012-11-26 10:04:42
【问题描述】:
我在 iframe 中有下一个代码,并且我实现了它在父级中显示,但现在我不知道如何将图像分组,如 fancybox 示例中的图像库。
我在一个例子中看到了这个:
$(document).ready(function() {
$('.imagen').click(function(e){
e.preventDefault();
parent.$.fancybox([
{href:'images/01.jpg', title: '01'},
{href:'images/02.jpg', title: '02'},
{href:'images/03.jpg', title: '03'}
],{
// href: this.href,
helpers: {
overlay: {...............
但我不希望这样,因为链接将是动态的。我想使用类似的东西
$(".fancybox") .attr('rel', 'gallery') 并像使用它一样
<a class="fancybox" rel="gallery" href="Lector.ashx?ImagenId=0" >
要实现查看所有带有下一步按钮的 img 作为图片库,但我不需要修改。
我的代码:
<script type="text/javascript">
$(document).ready(function () {
$('.fancybox').click(function (e) {
e.preventDefault();
parent.$.fancybox({
href: this.href,
helpers: {
title: { type: 'inside' },
overlay: {
opacity: 0.3
} // overlay
//, buttons: {}
} // helpers
}); // fancybox
}); // click
});
</script>
身体
<a class="fancybox" href="Lector.ashx?ImagenId=14" >
<img alt="" src="../Resources/background.png" width="100" height="100"/>
</a>
<a class="fancybox" href="Lector.ashx?ImagenId=6">
<img alt="" src="Lector.ashx?ImagenId=6" width="100" height="100"/>
</a>
<a class="fancybox" href="Lector.ashx?ImagenId=20">
<img alt="" src="Lector.ashx?ImagenId=6" width="100" height="100"/>
</a>
我正在使用 fancybox 2.1.3 请帮助我!!!! 提前致谢
I have to do this?
$(document).ready(function () {
$('.fancybox').click(function (e) {
like i said before at start???
});//click
$('.fancybox').attr('rel', 'gallery').fancybox({
JFK code??
});
});//
【问题讨论】:
-
您是否查看过 Fancy box 文档寻求帮助?
-
是的,我看到了这个 Open something 但它不适用于 ashx
标签: jquery jquery-plugins fancybox fancybox-2