zoukankan      html  css  js  c++  java
  • 大图 预览

    <!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>
  • 相关阅读:
    Perl-统计某电路面积、功耗占比(NVDIA2019笔试)
    Tensorflow 之 loss
    Verilog-同步FIFO
    Verilog-case、casez和casex的区别
    modelsim使用命令
    进制转换工具
    串口写入和读取数据
    串口发送数据——字符串发送与十六进制发送的区别
    字符转换为十六进制 字符串转化为字符数组
    VS2008编了个MFC对话框,编译链接都没有问题,但是运行出来的对话框完全不能点击
  • 原文地址:https://www.cnblogs.com/lgzh3/p/2373249.html
Copyright © 2011-2022 走看看