简体   繁体   English

位置灯箱-Fancybox

[英]Position Lightbox - Fancybox

I need to position my lightbox over a part of the image. 我需要将灯箱放在图片的一部分上。 I tried adding this CSS: 我尝试添加此CSS:

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

When I do that it breaks the lightbox. 当我这样做时,它会破坏灯箱。 How do I position the lightbox? 如何放置灯箱? (I am using Fancybox) here is my HTML: (我正在使用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>

Now how do I position the image where I want it displayed in the lightbox? 现在如何将图像放置在想要在灯箱中显示的位置?

You need to target fancybox-outer 您需要定位fancybox-outer

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM