图片预览功能


  <td align="left">
                        <img style='width: 20px; height: 16px; cursor: pointer;' onmouseover='showClient(this);'
                            src="/manage/Files/HeatPump/<%#Eval("Smallpic") %>" onmouseout='$("#divClient").hide();'
                            onerror='this.src="/images/img.gif"; this.style.width=16' />
                        <img id="divClient" style="position: absolute; z-index: 9999; display: none; border: 1px solid;
                            border-color: Gray; padding: 1px; width: 500px; height: 400px;" />
                    </td>



<script>
 function showClient(ele) {
            if (ele.src.toLowerCase().indexOf("img.gif") == -1) {
                var X = $(ele).offset().top - 3;
                var Y = $(ele).offset().left + 20;
                $("#divClient").attr("src", ele.src).show().css("left", Y).css("top", X);
            }
        }

</script>
posted @ 2015-09-10 16:29  Pavilion  阅读(222)  评论(0)    收藏  举报