gpt4 book ai didi

javascript - 如何使用灯箱选项?

转载 作者:行者123 更新时间:2023-11-28 06:48:30 26 4
gpt4 key购买 nike

如何使用 Lightbox 2 选项?如何包含在文档中?它无法按照网站 http://lokeshdhakar.com/projects/lightbox2/#options 上的指定工作

<script>
lightbox.option({
'resizeDuration': 200,
'wrapAround': true
})
</script>


<a class="example-image-link" data-lightbox="example-set" href="pic.png">
<img style="width: 100%" src="pic.png">
</a>

如何设置灯箱选项?

最佳答案

确保您同时包含 lightbox.js lightbox.css 样式表。

您还需要 jQuery 1.7 或更高版本(如 Getting Started section of the Lightbox website 的步骤 4 中所述)。您应该在灯箱脚本之前包含 jQuery 脚本。

这个设置对我有用:

<!DOCTYPE html>
<html>

<head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/lightbox2/2.7.1/css/lightbox.css" />
<script src="jquery-1.11.3.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lightbox2/2.7.1/js/lightbox.min.js"></script>
</head>

<body>
<a class="example-image-link" data-lightbox="example-set" href="pic.png">
<img style="width: 100%" src="pic.png">
</a>

<script>
lightbox.option({
'resizeDuration': 200,
'wrapAround': true
})
</script>
</body>

</html>

关于javascript - 如何使用灯箱选项?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33187342/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com