我在这里失去了我的想法。我有一个冲突让云变焦在fancybox内工作。我将它缩小到与我的#fancyboxContent样式设置为“display:none;”有关因为如果我删除 - cloudzoom将在fancybox中工作 - 不幸的是,这意味着它可以在我的主页上看到,然后打开覆盖fancybox,这打破了目的。cloudzoom与fancybox冲突?
这似乎是一个常见的问题,因为我发现这个问题的其他三个版本的SO,但不幸的是,他们没有得到答复...
所以,我有两个网页运行 - 先用cloudzoom的工作,因为在div可见 (点击第一个作品“Auzie的屁股”,看的fancybox/cloudzoom工作: http://test.fatcat-studios.com/RnR/art_kelly_dodge2.html
这里的页面看,因为它应该用的fancybox DIV隐藏,但如果你点击“Auzie's Ass”(我没有命名它!),那么你会看到fanycbox打开,但没有缩放功能: http://test.fatcat-studios.com/RnR/art_kelly_dodge.html
任何想法?我在截止日期前拉出我的头发! 这似乎是问题的代码,但我不明白为什么!
<style>
div#FancyboxContent {
display:inherit;
}
</style>
谢谢!
UPDATE: FYI:所以,我能够得到这个使用这个工作,不知道这是最好的办法:
$("a.various").fancybox({
'scrolling' : 'no',
'overlayColor' : '#000',
'overlayOpacity': '0.9',
'transitionIn' : 'none',
'transitionOut' : 'none',
'titlePosition' : 'inside',
'onComplete' : function(arg) {
// Here does the magic starts
$('#fancybox-img').wrap(
$('<a>')
.attr('href', $(arg[0]).attr('href'))
.addClass('cloud-zoom')
.attr('rel', "position: 'inside'")
);
// That's it
$('.cloud-zoom').CloudZoom();
}
});
与此HTML:
<a class="various" href="#inline1">Fancybox Open</a>
<div style="display: none;">
<div id="inline1" style="width:700px;height:600px;">
<table id="TableContent">
<tr><td style="vertical-align: top;" width="305">
<a href='../content/art/kellydodge/Australorpe_Ass.jpg' class='cloud-zoom' id='zoom1' rel="adjustX: 0, adjustY:-4">
<img src="../content/art/kellydodge/Australorpe_Ass.jpg" width="300" title="Auzie's Ass" /></a>
</td>
<td style="vertical-align: top;">
<p><b>Kelly Dodge</b></p>
<p>text here</p>
</td></tr></table>
</div>
</div>
它可以是看到这里:test.fatcat-studios.com/RnR/fancybox/index2.html
非常感谢!
凡在页面上是控制这个的JavaScript? – Fresheyeball 2012-03-19 02:38:59