gpt4 book ai didi

javascript - Shadowbox 在初始页面加载时加载照片库

转载 作者:行者123 更新时间:2023-12-02 17:46:54 25 4
gpt4 key购买 nike

我能够将shadowbox设置为在页面加载时初始化以显示照片,但我需要它来显示一堆照片,在查看shadowbox站点后,我找不到如何执行此操作。页面 html:

<link rel="stylesheet" type="text/css" href="C:\Users\Jason\sitebuilder\sites\UltimateFinishAutoDetailing\files\shadowbox-3.0.3/shadowbox.css">
<script type="text/javascript" src="C:\Users\Jason\sitebuilder\sites\UltimateFinishAutoDetailing\files\shadowbox-3.0.3/shadowbox.js"></script>
<script type="text/javascript">
Shadowbox.init();
</script>

<script type="text/javascript">
Shadowbox.init({
skipSetup: true
});
window.onload = function() {
Shadowbox.open({
content:'images/IMG00255-20110531-1435.jpg',
player: "img",
title: "Before and After- Hyundai Tiburon",
height: 400,
width: 700
});
};
</script>

最佳答案

我找不到使用内置函数的 Shadowbox 的方法,但这非常简单,应该可以正常工作。

<!DOCTYPE html>
<html>
<head>
<title>Shadowbox</title>
</head>

<link rel="stylesheet" type="text/css" href="shadowbox.css">
<style type="text/css">
/* Hide all <a> tags */
a[rel~="shadowbox"]{
display: none;
}
</style>
<script type="text/javascript" src="shadowbox.js"></script>
<script type="text/javascript">
Shadowbox.init();
</script>

<!-- on page load, fake a click to call shadowbox -->
<body onload="document.getElementById('first').click();">

<!-- put all gallery items like this. Only the first link needs the id "first". -->
<a href="https://www.google.co.nz/images/srpr/logo11w.png" rel="shadowbox[Gallery]" id="first"></a>
<a href="https://www.google.co.nz/images/srpr/logo11w.png" rel="shadowbox[Gallery]"></a>

</body>
</html>

关于javascript - Shadowbox 在初始页面加载时加载照片库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21666863/

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