• 大图 预览


    <!DOCTYPE html>
    <html lang="en">
      <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <title>Explaining the Document Object Model</title>
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
            <script>
                    $(function(){
                            var x = 10;
                            var y = 20;
                            $("a.tooltip").mouseover(function(e){
                                    this.myTitle = this.title;
                                    this.title = "";
                                    var imgTitle = this.myTitle ? "<br />" + this.myTitle +" 产品预览图" : "";
                                    var tooltip = "<div id='tooltip'><img src='"+this.href+"' alt='产品预览图' width='500' height='500' />"+imgTitle+"</div>";
                                            $("body").append(tooltip);
                                            $("#tooltip")
                                                    .css({
                                                            "top": (e.pageY+y) + "px",
                                                            "left":(e.pageX+x) + "px"
                                            }).show("fast");
                            }).mouseout(function(e){
                                    this.title = this.myTitle;
                                    $("#tooltip").remove();
                            }).mousemove(function(e){
                                    $("#tooltip").css({
                                            "top": (e.pageY+y) + "px",
                                            "left": (e.pageX+x) + "px"
                                    });
                            });
                    })
            </script>
            <style>
                    ul{margin: 30px auto; 1440px;}
                    ul li{float: left; padding-right: 50px; list-style: none;}
                    ul li img{ 100px; height: 100px; padding: 10px; border: 1px solid #ccc; background-color:#eee; -webkit-border-radius: 8px;}
                    #tooltip{
                            position: absolute;
                            background-color: #eee;
                            border: 1px solid #999;
                            500px;
                            height: 520px;
                            -webkit-border-radius: 8px;
                            font-family: "微软雅黑";
                            padding: 20px;
                    }
            </style>
      </head>
      <body>
            <ul>
                    <li><a href="images/imac.jpg" title="苹果 iMac" class="tooltip"><img src="images/imac.jpg" alt="苹果 iMac" /></a></li>
                    <li><a href="images/iphone.jpg" title="苹果 iPhone" class="tooltip"><img src="images/iphone.jpg" alt="苹果 iPhone" /></a></li>
                    <li><a href="images/sb.jpg" title="苹果 鼠标" class="tooltip"><img src="images/sb.jpg" alt="苹果 鼠标" /></a></li>
                    <li><a href="images/jp.jpg" title="苹果 键盘" class="tooltip"><img src="images/jp.jpg" alt="苹果 键盘" /></a></li>
            </ul>
      </body>
    </html>
  • 相关阅读:
    Linux下利用rsync实现多服务器文件同步
    SVN使用import导入新数据到版本库
    SVN协同开发时服务端与线上APACHE测试环境网站同步记录 转
    [转]rsync的配置与应用
    Matrix 旋转mc 注册点在mc的左上角
    多边形面积计算
    【神奇的代码】
    【碰撞回弹】
    三角函数
    判断点是否在线段或直线上
  • 原文地址:https://www.cnblogs.com/lgzh3/p/2373249.html
Copyright © 2020-2023  润新知