[英]jquery superbox library not working
您好,我正在測試jquery超級框庫。 我有以下示例:
<html>
<head>
<title>LIGHTBOX EXAMPLE</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.superbox-min.js"></script>
<script type="text/javascript" src="js/jquery.superbox.js"></script>
<link rel="stylesheet" type="text/css" href="js/jquery.superbox.css">
<script>
$(function(){
$.superbox();
});
</script>
</head>
<body>
<a href="#box-content" rel="superbox[content]">SuperBox</a>
</body>
</html>
但是,當我單擊鏈接時,沒有任何反應。 有人知道為什么它行不通嗎?
如果您檢查控制台日志,您將看到以下錯誤: TypeError: i.browser is undefined
由於該插件是舊版本,並且您正在嘗試使用jQuery 2.1.1,因此會出現此錯誤,因為在插件的源代碼中,正在使用$.browser
功能,該功能已在jQuery 1.9之后被刪除。
另外,您沒有ID為box-content
任何元素。 因此,也將其添加到您的html中。
對於工作示例,請檢查以下小提琴: http : //jsfiddle.net/Hxe89/
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.