, , ( ) , 100%. jquery, , ( 15 , , -, ).
function getZoom(){
var ovflwTmp = $('html').css('overflow');
$('html').css('overflow','scroll');
var viewportwidth;
if (typeof window.innerWidth != 'undefined') {
viewportwidth = window.innerWidth;
} else if (typeof(document.documentElement) != 'undefined' &&
typeof document.documentElement.clientWidth != 'undefined' &&
document.documentElement.clientWidth != 0) {
viewportwidth = document.documentElement.clientWidth;
} else {
viewportwidth = document.getElementsByTagName('body')[0].clientWidth;
}
var windW = $(window).width();
var scrollBarW = viewportwidth - windW;
if(!scrollBarW) return 1;
$('html').css('overflow',ovflwTmp);
return (15 / scrollBarW);
}
, , . , , , .