使用Lightbox Jquery插件

时间:2012-04-24 18:03:21

标签: javascript jquery lightbox

我设计了一个网页,左边有一个div元素,中间有iframe,右边有另一个iframe。

1.在中心iframe中,我点击这些图像时加载缩略图图像,调用灯箱插件,并且必须在整个文档上显示较大的图像(背景模糊)。

2.问题我面临的问题是灯箱插件是在中心iframe内部而不是在整个文档中加载(就像在许多社交网站中一样)。

3.我从互联网上下载了lightbox插件并在我的网页中使用

4.我希望借助灯箱将图像显示在整个文档中。

非常感谢任何帮助

这是我写的代码片段

<!--this code is written in home page-->
<div>
<ul>
        <li><a href="http://localhost/php/image.php?category=sea" target="description" class="underline">SEA</a></li>
        <li><a href="http://localhost/php/image.php?category=ANIMALS" target="description" class="underline">ANIMALS &amp; BIRDS</a></li>
        <li><a href="http://localhost/php/image.php?category=plants" target="description" class="underline">plants</a></li>
     <li><a href="http://localhost/php/image.php?category=Tourism" target="description" class="underline">Tourism</a></li>
<ul>
</div> 
<filedset><iframe name="description" width="725px" height="800px" align="left" frameborder="0" id="description"></iframe></fieldset>
<fieldset>
<iframe name="info" width="300px" height="380px" frameborder="0" src="UserInformation.php" id="iframeid"><!--logged in user's information-->
</iframe>
</fieldset>
<!--this code is written in image.php file-->
<head>
//calling JQUERY LIGHT BOX PLUGIN HERE ON clicking an image displayed in this page(within iframe name="description")
<script type="text/javascript" src="../js/jquery.js"></script>
<script type="text/javascript" src="../js/jquery.lightbox-0.5.js"></script>
<link rel="stylesheet" type="text/css" href="../css/jquery.lightbox-0.5.css" media="screen" />
<script type="text/javascript">
    $(function() {
        $('#gallery a').lightBox();
    });
    </script>
</head>

感谢。

1 个答案:

答案 0 :(得分:0)

我已经找到了我所遇到的问题的解决方案,这里

http://www.dynamicdrive.com/forums/archive/index.php/t-19051.html

相关问题