物质izecss unturef typeError:$(...)。旋转木马不是功能
在使用positalizecss框架的同时,我从! :
Uncaught TypeError: $(...).carousel is not a function
at HTMLDocument.<anonymous> (index.html:48:24)
at e (jquery.min.js:2:30038)
at t (jquery.min.js:2:30340)
在使用jQuery和positalizecss框架时:
<html>
<head>
<!--Import Google Icon Font-->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<!-- Compiled and minified CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
<!-- Compiled and minified JavaScript -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
<!--Let browser know website is optimized for mobile-->
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
</head>
<body>
<div class="carousel">
<a class="carousel-item" href="#one!"><img src="http://2.ngsoft.de/E3sAmcr">Hallo</a>
<a class="carousel-item" href="#two!"><img src="http://2.ngsoft.de/9i7nKEo"></a>
</div>
<script>
$(document).ready(function(){
$('.carousel').carousel();
});
</script>
</body>
</html>
我想我没有加载两次...
i got this console error while using MaterializeCss framework from https://materializecss.com/carousel.html#one! :
Uncaught TypeError: $(...).carousel is not a function
at HTMLDocument.<anonymous> (index.html:48:24)
at e (jquery.min.js:2:30038)
at t (jquery.min.js:2:30340)
While using jQuery and MaterializeCss framework:
<html>
<head>
<!--Import Google Icon Font-->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<!-- Compiled and minified CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
<!-- Compiled and minified JavaScript -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
<!--Let browser know website is optimized for mobile-->
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
</head>
<body>
<div class="carousel">
<a class="carousel-item" href="#one!"><img src="http://2.ngsoft.de/E3sAmcr">Hallo</a>
<a class="carousel-item" href="#two!"><img src="http://2.ngsoft.de/9i7nKEo"></a>
</div>
<script>
$(document).ready(function(){
$('.carousel').carousel();
});
</script>
</body>
</html>
I think i do not have jQuery loaded twice...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,我明白了,我只需要在
jQuery
脚本加载之前Okay I got it, I just had to load the
jQuery
script before theMaterializeCss
one... Thats all