gpt4 book ai didi

javascript - 未捕获的引用错误 : Mosaic is not defined

转载 作者:行者123 更新时间:2023-11-28 12:12:53 25 4
gpt4 key购买 nike

我有兴趣使用这个MosaicJS plugin 。这些说明看起来很简单,所以我尝试复制基本实现。

$('#myMosaic').Mosaic();
<html>

<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery-mosaic/0.131/jquery.mosaic.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/jquery-mosaic/0.131/jquery.mosaic.css" />
</head>

<body>
<div id="myMosaic">
<img src="https://placeimg.com/640/480/all" width="400" height="350" />
<img src="https://placeimg.com/640/480/all" width="320" height="200" />
<img src="https://placeimg.com/640/480/all" width="870" height="420" />
<img src="https://placeimg.com/640/480/all" width="442" height="922" />
</div>

当我这样做时,我收到与 JS 脚本部分相关的错误:

Uncaught ReferenceError: Mosaic is not defined at (index):131

还有人遇到这个问题吗?我在 HTML head 部分中建立了指向实际 jquery 马赛克文件的正确链接。可以实现什么样的解决方案?谢谢!

最佳答案

试试这个。

$(document).ready(function(){
$('#myMosaic').Mosaic();
});

关于javascript - 未捕获的引用错误 : Mosaic is not defined,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56963344/

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