图片预览功能


  <td align="left">
                        <img style='width20pxheight16pxcursorpointer;' 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="positionabsolutez-index9999displaynoneborder1px solid;
                            border-colorGraypadding1pxwidth500pxheight400px;" />
                    </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  阅读(201)  评论(0编辑  收藏  举报