我使用ubergallery
的图片库,我复制一个弹出窗体的脚本,我变成了接触,我们形成弹出。冲突的ubergallery和自定义脚本
当我使用这两个脚本,我ubergallery
不起作用。两种脚本可以一起使用吗?
脚本是正确的顺序,根据我遵循的指示。我只是不知道要删除/更改哪一个函数才能工作。
<!-- script/css for ubergallery -->
<link rel="stylesheet" type="text/css" href="assets/resources/UberGallery.css" />
<link rel="stylesheet" type="text/css" href="assets/resources/colorbox/1/colorbox.css" />
<script type="text/javascript" src="://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript" src="assets/resources/colorbox/jquery.colorbox.js"></script>
<script type="text/javascript" src="resources/colorbox/jquery.colorbox.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("a[rel='Images 1']").colorbox({maxWidth: "90%", maxHeight: "90%", opacity: ".5"});
$("a[rel='Images 2']").colorbox({maxWidth: "90%", maxHeight: "90%", opacity: ".5"});
$("a[rel='Images 3']").colorbox({maxWidth: "90%", maxHeight: "90%", opacity: ".5"});
$("a[rel='Images 4']").colorbox({maxWidth: "90%", maxHeight: "90%", opacity: ".5"});
$("a[rel='Images 5']").colorbox({maxWidth: "90%", maxHeight: "90%", opacity: ".5"});
$("a[rel='Images 6']").colorbox({maxWidth: "90%", maxHeight: "90%", opacity: ".5"});
});
</script>
<!--script/css for pop-up form-->
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<link rel="stylesheet" href="/resources/demos/style.css">
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script>
这是我的错误:
Uncaught TypeError: $(...).colorbox is not a function at HTMLDocument. (##.php:24) at j (jquery.js:2) at Object.fireWith [as resolveWith] (jquery.js:2) at Function.ready (jquery.js:2) at HTMLDocument.J (jquery.js:2)
您在浏览器控制台中遇到什么错误?为什么你包含jQuery两次,还有两个不同的版本? – j08691
这些脚本中是否有多个document.ready函数? –
对不起,我是新来的PHP。我只是把我找到的不同的脚本放在一起。 – Rye