您的位置:首页 > 其它

放大缩小图片

2016-04-05 22:44 344 查看
<!DOCTYPE html>

<html>

<head>

<title>放大缩小图片</title>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

</head>

<body>

<script type="text/javascript">

        //兼容IE和火狐   缩小放大、缩放

        function ImageSuofang(args) {

            var oImg = document.getElementById("oImg");

            if (args) {

                oImg.width = oImg.width * 2;

                oImg.height = oImg.height * 2;

                setInterval("",2000);

            }

            else {

                oImg.width = oImg.width / 2;

                oImg.height = oImg.height / 2;

                setInterval("",2000);

            }

        }    

     </script>

</script>

<form id="form1">

     <div class="container">

        <img id="oImg" src="img/1.jpg" alt="pic" onmouseover="ImageSuofang(true)" onmouseout="ImageSuofang(false)" />

    </div>

</form>

</body>

</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: