PrettyPhoto jquery 插件不起作用
我正在使用 PrettyPhoto jquery 插件在我的页面上显示图片库,但由于某种原因它不起作用。我正在本地主机上尝试此操作,并且使用 Zend Framework。
这是我的代码:
<script type="text/javascript" src="<?php echo URLgenerator::getScryptURL('jquery.js'); ?>"></script>
<link rel="stylesheet" href="<?php echo URLgenerator::getStyleURL('prettyPhoto/css/prettyPhoto.css'); ?>" type="text/css" media="screen" charset="utf-8" />
<script src="<?php echo URLgenerator::getScryptURL('prettyPhoto/js/jquery.prettyPhoto.js'); ?>" type="text/javascript" charset="utf-8"></script>
主要部分:
<?php
$photos = $project->getPhotos();
foreach($photos as $photo):
?>
<a href="<?php echo $photo->getPhotoURL(); ?>" rel='prettyPhoto[pp_gal]'>
<img src="<?php echo $photo->getPhotoURL(); ?>" alt="" class="ProjectPageImage" />
</a>
<?php
endforeach;
?>
在页面末尾:
<script type="text/javascript" charset="utf-8">
$(document).ready(function(){
$("a[rel^='prettyPhoto']").prettyPhoto({
deeplinking: false
});
});
</script>
我得到的是一种奇怪的画廊,附加在页面末尾的所有内容下,而不是我应该得到的“灯箱”弹出窗口。
I am using the prettyPhoto jquery plugin to show a gallery of pictures on my page, and it doesn't work for some reason. I am trying this on my localhost and I use Zend Framework.
This is my code:
<script type="text/javascript" src="<?php echo URLgenerator::getScryptURL('jquery.js'); ?>"></script>
<link rel="stylesheet" href="<?php echo URLgenerator::getStyleURL('prettyPhoto/css/prettyPhoto.css'); ?>" type="text/css" media="screen" charset="utf-8" />
<script src="<?php echo URLgenerator::getScryptURL('prettyPhoto/js/jquery.prettyPhoto.js'); ?>" type="text/javascript" charset="utf-8"></script>
The main part:
<?php
$photos = $project->getPhotos();
foreach($photos as $photo):
?>
<a href="<?php echo $photo->getPhotoURL(); ?>" rel='prettyPhoto[pp_gal]'>
<img src="<?php echo $photo->getPhotoURL(); ?>" alt="" class="ProjectPageImage" />
</a>
<?php
endforeach;
?>
at the end of the page:
<script type="text/javascript" charset="utf-8">
$(document).ready(function(){
$("a[rel^='prettyPhoto']").prettyPhoto({
deeplinking: false
});
});
</script>
What I get is a weird sort of gallery appended at the end of the page under everything, and not the "lightbox" popup I should get.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由于您提到正在添加标记,但未按您期望的方式显示。然后您应该检查 CSS 文件是否已加载,因为样式似乎未应用于元素。
Since you mention that the markup is being added, but is not displaying the way you expect it to be. Then you should check the CSS file is loaded, because it seems like the styling is not applied to the elements.