我有兴趣使用这个MosaicJS 插件。说明看起来很简单,所以我尝试复制基本实现。
$('#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 脚本部分相关的错误:
未捕获的 ReferenceError:马赛克未在(索引)处定义:131
其他人有这个问题吗?我在 HTML 头部分中正确链接到实际的 jquery 马赛克文件。可以实施什么样的解决方案?谢谢!