代码之家  ›  专栏  ›  技术社区  ›  NeuronButter

固定操作按钮工作不正常?

  •  0
  • NeuronButter  · 技术社区  · 6 年前

    我正在努力学习Materialize(materialiecss.com),我一直在学习如何制作动作按钮。左下角的按钮会出现,但当我悬停时,其他按钮不会出现。

    <!DOCTYPE html>
        <html>
        <head>
            <!--Import Google Icon Font-->
            <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
            <!--Import materialize.css-->
            <link type="text/css" rel="stylesheet" href="css/materialize.min.css"  media="screen,projection"/>
        
            <!--Let browser know website is optimized for mobile-->
            <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
        </head>
        
        <body>
        <script type="text/javascript" src="js/materialize.min.js"></script>
        <div class="fixed-action-btn">
            <a class="btn-floating btn-large red">
                <i class="large material-icons">mode_edit</i>
            </a>
            <ul>
                <li><a><i class="material-icons">publish</i></a></li>
                <li><a><i class="material-icons">publish</i></a></li>
            </ul>
        </div>
        <!--JavaScript at end of body for optimized loading-->
        
        </body>
        </html>

    帮助提前谢谢。

    1 回复  |  直到 6 年前
        1
  •  0
  •   Nidhi    6 年前

    我在代码中添加了jquery,它对我来说工作得很好,
    请参见下面的我的代码:

    <!DOCTYPE html>
        <html>
        <head>
            <!--Import Google Icon Font-->
            <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
            <!--Import materialize.css-->
           <link href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/css/materialize.min.css" rel="stylesheet"/>
            <!--Let browser know website is optimized for mobile-->
            <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
            
        </head>
        
        <body>
            <div class="fixed-action-btn">
            <a class="btn-floating btn-large red">
                <i class="large material-icons">mode_edit</i>
            </a>
            <ul>
                <li><a><i class="material-icons">publish</i></a></li>
                <li><a><i class="material-icons">publish</i></a></li>
            </ul>
        </div>
        <!--JavaScript at end of body for optimized loading-->
         <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/js/materialize.min.js"></script>
        </body>
        </html>