鼠标放图片上图片放大效果

添加人:vs2008零级(63分)   添加时间:2008-06-26    阅读次数:427  收藏此教程

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>JavaScript Test</title>
</head>

<script type="text/javascript">
//*******
//鼠标移入显示大图片
//*******
function yiru(t){   
    var ei = document.getElementById("big_image");
    ei.style.display = "block";
 ei.innerHTML = '<img src="' + t.src + '" width="280px" height="280px" />';
 ei.style.top  =document.body.scrollTop+window.event.clientY+10+"px";
 ei.style.left =window.event.clientX+10+"px";
}

//*******
//鼠标移出隐藏大图片
//*******
function yichu(){
    var ei = document.getElementById("big_image");
    ei.innerHTML = "";
 ei.style.display = "none";
}

</script>

<body>
    <form id="form1" runat="server">
    <div id="big_image" style="position: absolute; display: none; z-index: 2; border: 0px solid #f4f4f4;">
    </div>
    <div>
        <table>
            <tr>
                <td style="width: 152px">
                    <img border="0" src="images/http_imgload.jpg" onmousemove="yiru(this);" onmouseout="yichu(this);" style="width: 148px; height: 134px" />
                </td>
            </tr>
        </table>
    </div>
        <br />
        <br />
        <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
    </form>
</body>
</html>

 

1页 第1上一页1下一页
相关的教程: 图片放大
收藏此教程

当前平均分: 1.0(1 次打分)

-5-4-3-2-1012345
评论主题
您的大名
您的评论
验证码 点击换一个验证码
知识库搜索: