2011-10-26 70 views
0

我需要將我的燈箱放置在圖像的一部分上。我試圖添加這個CSS:位置燈箱 - Fancybox

#globe{ 
position:absolute; 
left:170px; 
top: 50px; 
} 

當我這樣做,它打破了燈箱。我如何定位燈箱? (我用的fancybox)這裏是我的HTML:

<p><a id="fancy" href="#globe"><img class="center" style="width:620px;" 
src="/messages4u/2011/images/october/baby-n-grandfather.jpg" /></a></p> 
<p>&nbsp;</p> 
<p>&nbsp;</p> 
<div class="hide"><div id="globe"> 
<img src="/messages4u/2011/images/october/globe-text.png" width="400" 
height="400" /></div></div> 

<script type="text/javascript"> 
var $j = jQuery.noConflict(); 
$j(document).ready(function() { 
$j("a#fancy").fancybox({ 
    'padding' : 0, 
    'overlayShow' : false, 
}); 
}); 
</script> 

現在我該怎樣圖像位置,我希望它顯示在燈箱嗎?

+0

您更改的條目,被它現在的工作,做了的fancybox來了嗎?你只是想把它放在別的地方呢? – 2011-10-26 08:33:54

+0

是的CSS導致它打破並不顯示。修正了所以我重新提出問題,問我關於我的下一個問題,那就是如何定位燈箱。 – L84

+0

你的意思是你想只顯示特效部分的圖像效果? – coder

回答

0

您的需要爲目標的fancybox,外

#fancybox-outer{ 
position:absolute; 
left:170px; 
top: 50px; 
} 
+0

它實際上是#fancybox包裝。我現在知道了=> – L84

+1

也Lynda,你可以重寫你的jQuery代碼到這個:jQuery(function(){ $(「a#fancy」)。fancybox({padding':0, 'overlayShow ':false }); }); – 2011-10-26 08:43:11