我目前正在为自己开发小型画廊网站并显示我决定使用 LightBox v2 插件的每张图片。 http://lokeshdhakar.com/projects/lightbox2/
但不幸的是,这并不像我想的那样简单。该插件有效,我的意思是,我可以在灯箱中显示图像(我有上一个/下一个按钮,这不是问题)但是每个图像的宽度都缩小了,我真的不明白为什么!
这里是我的代码:
<h2>Par Catégorie</h2>
<?php
$reqcategorie = db_query('SELECT * FROM photos');
while($donneecategorie = $reqcategorie->fetch()) {
?>
<a href="index.php?page=fiche&categorie=<?php echo $donneecategorie['categorie'];?>"><?php echo $donneecategorie['categorie'];?></a>
<?php
}
?>
如果你已经使用过这个插件并且遇到过这个问题,请告诉我你是怎么解决的。
PS:我用的是 Twitter Bootstrap,两者之间有什么不兼容的地方吗?
最佳答案
添加以下css规则:
.lb-image{
max-width: inherit;
}
Bootstrap 将默认的 img max-width 设置为 100%,并且由于某种原因灯箱停止调整大小。
-- 解决方案由 https://github.com/kiballion 通过电子邮件发送给我.信用到期。
关于plugins - LightBox v2 缩小框中的图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17523977/