我使用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