Material Design Lite-JS不应用事件侦听器

非对称

我在Material Design Lite库中遇到了一个奇怪的问题。body根据文档,在关闭标签之前,我已经包含了mdl js脚本标签但是,我无法从mdl库应用样式。在检查开发工具后,我发现事件监听material.min.js器没有被应用到文本字段和按钮等。我附加了两个图像以更好地解释这种情况。

MDL文件正在正确加载。

如您所见,文件正在加载中...

样式无法正常工作

但是我看不到来自MDL的文本字段的任何动画。

PS。我正在本地服务器上运行网站。任何帮助将不胜感激。谢谢...

HTML:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta content="width=device-width, initial-scale=1" name="viewport">
    <title>Page Title</title>
    <!-- google font -->
    <link href="https://fonts.googleapis.com/css?family=Poppins:300,400,500,600,700" rel="stylesheet" type="text/css" />
    <!-- icons -->
    <link href="/static/portal/assets/fonts/simple-line-icons/simple-line-icons.min.css" rel="stylesheet" type="text/css" />
    <link href="/static/portal/assets/fonts/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
    <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
    <!--bootstrap -->
    <link href="/static/portal/assets/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />

    <!-- Material Design Lite CSS -->
    <link rel="stylesheet" href="/static/portal/assets/plugins/material/material.min.css">
    <link rel="stylesheet" href="/static/portal/assets/css/material_style.css">
    <!-- Theme Styles -->
    <link href="/static/portal/assets/css/theme/light/theme_style.css" rel="stylesheet" id="rt_style_components" type="text/css" />
    <link href="/static/portal/assets/css/theme/light/style.css" rel="stylesheet" type="text/css" />
    <link href="/static/portal/assets/css/plugins.min.css" rel="stylesheet" type="text/css" />
    <link href="/static/portal/assets/css/responsive.css" rel="stylesheet" type="text/css" />
    <link href="/static/portal/assets/css/theme/light/theme-color.css" rel="stylesheet" type="text/css" />
</head>
<body class="page-header-fixed sidemenu-closed-hidelogo page-content-white page-md">
...
<!-- start js include path -->
<script src="/static/portal/assets/plugins/jquery/jquery.min.js" ></script>
<script src="/static/portal/assets/plugins/popper/popper.js" ></script>
<script src="/static/portal/assets/plugins/jquery-blockui/jquery.blockui.min.js" ></script>
<script src="/static/portal/assets/plugins/jquery-slimscroll/jquery.slimscroll.js"></script>
<!-- bootstrap -->
<script src="/static/portal/assets/plugins/bootstrap/js/bootstrap.min.js" ></script>
<!-- Common js-->
<script src="/static/portal/assets/js/app.js" ></script>
<script src="/static/portal/assets/js/layout.js" ></script>
<script src="/static/portal/assets/js/theme-color.js" ></script>
<!-- Material -->
<script src="/static/portal/assets/plugins/material/material.min.js"></script>
<script src="/static/portal/assets/js/pages/material-select/getmdl-select.js" ></script>
<script  src="/static/portal/assets/plugins/material-datetimepicker/moment-with-locales.min.js"></script>
<script  src="/static/portal/assets/plugins/material-datetimepicker/bootstrap-material-datetimepicker.js"></script>
<script  src="/static/portal/assets/plugins/material-datetimepicker/datetimepicker.js"></script>
<!-- dropzone -->
<script src="/static/portal/assets/plugins/dropzone/dropzone.js" ></script>
<script src="/static/portal/assets/plugins/dropzone/dropzone-call.js" ></script>
<!-- end js include path -->


</body>
</html>
Benvc

这是MDL按钮的一个非常基本的工作示例,可以作为故障排除中的参考。

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Material Design Lite Button example</title>
  <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
  <link rel="stylesheet" href="https://code.getmdl.io/1.3.0/material.indigo-pink.min.css">
</head>

<body>

  <!-- Accent-colored raised button with ripple -->
  <button class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--accent">
    Button
  </button>

  <script src="https://code.getmdl.io/1.3.0/material.min.js"></script>

</body>

</html>

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章