gpt4 book ai didi

javascript - video gallery getting Uncaught TypeError : $(. ..).lightGallery 不是函数

转载 作者:行者123 更新时间:2023-11-29 21:41:17 26 4
gpt4 key购买 nike

我正在为我的视频库使用 video.js。我尝试了 video.js,但收到以下错误消息。

未捕获的类型错误:$(...).lightGallery 不是函数我的代码:

<html>
<head>
<link href="http://vjs.zencdn.net/4.12/video-js.css" rel="stylesheet">
<script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="http://vjs.zencdn.net/4.12/video.js"></script>
</head>

<body>
<!-- Hidden video div -->
<div style="display:none;" id="video1">
<video class="lg-video-object lg-html5 video-js vjs-default-skin" controls preload="none">
<source src="videos/test1.mp4" type="video/mp4">
Your browser does not support HTML5 video.
</video>
</div>
<div style="display:none;" id="video2">
<video class="lg-video-object lg-html5 video-js vjs-default-skin" controls preload="none">
<source src="videos/test2.mp4" type="video/mp4">
Your browser does not support HTML5 video.
</video>
</div>

<!-- data-src should not be provided when you use html5 videos -->
<ul id="video-gallery">
<li data-poster="video-poster1.jpg" data-sub-html="video caption1" data-html="#video1" >
<img src="1.jpg" />
</li>
<li data-poster="video-poster2.jpg" data-sub-html="video caption2" data-html="#video2" >
<img src="2.jpg" />
</li>
...
</ul>


</body>
<script>
$('#video-gallery').lightGallery({
videojs: true
});

</script>

</html>

请提出解决方案。

最佳答案

您似乎缺少 lightgallery 的脚本标签

<script src="https://cdnjs.cloudflare.com/ajax/libs/lightgallery/1.2.4/js/lightgallery.min.js"></script>

关于javascript - video gallery getting Uncaught TypeError : $(. ..).lightGallery 不是函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32821603/

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