zoukankan      html  css  js  c++  java
  • jQuery练习之图片跟随

    <!DOCTYPE html>
    <html>
        <head>
        <meta charset="UTF-8">
        <style>
            body{
              text-align:center;
            }
            #small{
                margin-top:40px;
            }
            #showBig{
                position:absolute;
                display:none;
            }
        </style>
        <!--引入jQuery库-->
        <script type="text/javascript" src="../lib/jquery-1.7.2.js"></script>
        <script type="text/javascript">
          
        $(function(){
            $("#small").bind("mouseover mouseout mousemove",function(event){
                if(event.type=="mouseover"){
                    $("#showBig").show();
                }
                else if(event.type=="mouseout"){
                    $("#showBig").hide();
                }
                else if(event.type=="mousemove"){
                    $("#showBig").offset({
                        left: event.pageX+50,
                        top: event.pageY+50 
                    });
                }
            });
        });
        </script>
        </head>
        <body>
            <img id="small" src="../img/small.jpg">
            <div id="showBig">
                <img src="../img/big.jpg" width="300px" height="300px">
            </div>
        </body>
    </html>
    
    
  • 相关阅读:
    Linux磁盘分区、挂载
    crond任务调度
    Form组件使用
    Django路由系统
    Django中模板简单使用
    ORM常用操作
    IO多路复用
    vscode必装插件
    Flask-RESTful扩展
    flask-caching
  • 原文地址:https://www.cnblogs.com/fate-/p/14711110.html
Copyright © 2011-2022 走看看