2011-03-02 4 views
1

다른 플러그인없이 jQuery를 사용하여 Firefox/Chrome 유사 효과를 확대/축소 할 수 있습니까?.click() 이벤트에서 Jquery를 확대/축소 <body>?

그렇다면 어떻게됩니까?

+0

"확대/축소"란 의미를 분명히 할 수 있습니까? 당신은'Ctrl +'와'Ctrl-'의 효과를 언급하고 있습니까? –

+0

현재이 작업을 수행 할 수 없습니다. 참조 : http://stackoverflow.com/questions/2578354/access-browsers-page-zoom-controls-with-javascript –

답변

9
var currentZoom = 1; 
$('button').click(function() { 
    currentZoom += 0.1; 
    $('body').css({ 
     zoom: currentZoom, 
     '-moz-transform': 'scale(' + currentZoom + ')' 
    }); 
}); 

jsFiddle.

+0

jquery.transform.js를 사용하면 크로스 브라우저 변환을 활성화 할 수 있습니다. https://github.com/louisremi/ jquery.transform.js – molokoloco

관련 문제