[英]Colorbox JQuery Can't get it to work
我是第一次使用colorbox,需要一些幫助。 我的文件在正確的文件夾中。 所以我不確定是什么問題。
這是我的代碼:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="colorbox.css" rel="stylesheet" type="text/css" />
<script src="jquery.colorbox-min.js"></script>
</head>
<title>Untitled Document</title>
<body>
<!--JQuery library-->
<a href="http://jquery.com/">jQuery</a>
<script src="jquery.js"></script>
<script>
var foo = "bar";
</script>
<!--Colorbox Call-->
<a class='gallery' href='images/DSC_0114.JPG'>Photo_1</a>
<a class='gallery' href='images/money2.jpg'>Photo_2</a>
<a class='gallery' href='images/money2.jpg'>Photo_3</a>
<script>
jQuery(document).ready(function() {
jQuery('a.gallery').colorbox();
});;
</script>
</body>
“ box”類“ id”“ box”的內容在這里
我是一個初學者,所以請指出您想的所有內容! =)
您先加載colorbox,再加載jquery。 它需要反過來。
<script src="jquery.js"></script>
<script src="jquery.colorbox-min.js"></script>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.