当前位置: 代码迷 >> JavaScript >> 怎么用JS模拟页面放大缩小的效果
  详细解决方案

怎么用JS模拟页面放大缩小的效果

热度:36   发布时间:2013-06-26 14:29:32.0
如何用JS模拟页面放大缩小的效果
就像按住ctrl同时转动鼠标滚轮,要整个区域放大缩小。ctrl+滚轮这个事件有没有办法获取?

------解决方案--------------------
$("#a").click(function () {
                asZoom($("#yourDiv"))
            });
 function asZoom(o) {
            var w = parseInt(o.css("width").replace("px", "")) * 2 + 'px',
            h = parseInt(o.css("height").replace("px", "")) * 2 + 'px';
            o.css({"width": w,"height":h});
        }
  相关解决方案