您的位置:首页 > 其它

图片随着鼠标移动而拉伸,超过固定div宽度,图片自动隐藏超过的部分

2010-03-24 15:33 746 查看
var Gifwidth=document.getElementById("yy").width; //图片宽
var Gifheight=document.getElementById("yy").height;//图片高

function test() //图片拉动事件

{
if(Gifwidth>1000)
{
document.getElementById("yy").width=Gifwidth-widthX;
document.getElementById("yy").height=350;
// document.getElementById("HiddenField1").value=Gifwidth-widthX;
}
else
{
document.getElementById("yy").width=Gifwidth+widthX;
document.getElementById("yy").height=350;
//document.getElementById("HiddenField1").value=Gifwidth+widthX;
}

}

<div style=" overflow:hidden;width: 800px; position: absolute; height: 400px" o id="dd">
<img alt="yyyy" id="yy" runat="server" ondragend="test(event)" style=" position: absolute;" /></div>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐