2013-10-18 118 views
1

请帮助... 我正在创建一个Web应用程序,在该应用程序中,我需要将浏览器的缩放级别设置为默认比1 ... 我曾尝试jquery resize()函数,这将不会对我有帮助,因为我没有得到如何获得像素的窗口宽度 任何帮助将被认为... thanx ...当窗口缩小/缩放级别小于1时,如何将窗口缩放设置为默认值

var winWidth = $(window).width(); 
$(window).resize(function() { 
    if (winWidth>"1500") 
    { 
     //how can i pass the values again to the window width so dat it will reset to default 
    } 
}); 
+0

这是一种问题[复本的http://stackoverflow.com/questions/9441557/how-to-增加浏览器的缩放级别,对网页加载(http://stackoverflow.com/questions/9441557/how-to-increase-browser-zoom-level-on-page-load)。请注意最高评分答案中列出的原因,为什么你不应该为用户做这件事。 – Derek

+0

thanx 4帮助先生.. –

回答

1

对于铬及以上;

transform: scale(2); 
    -webkit-transform: scale(2); 
    -webkit-transform-origin: 0 0; 
    -moz-transform: scale(2); 
    -moz-transform-origin: 0 0; 
    -o-transform: scale(2); 
    -o-transform-origin: 0 0; 
    -ms-transform: scale(2); 
    -ms-transform-origin: 0 0; 

IE 7和8

zoom: 2; 

例子是here