Tema: font-size
Pogledajte određenu poruku
Staro 09. 07. 2013.   #8
stanke
član
Certified
 
Datum učlanjenja: 06.09.2012
Poruke: 64
Hvala: 0
342 "Hvala" u 10 poruka
stanke is on a distinguished roadstanke is on a distinguished roadstanke is on a distinguished roadstanke is on a distinguished road
Default

Pronasao sam resenje ako nekome treba:
<script type="text/javascript">
var original_layout_size = 1024; // arbitrary
var root_element = document.getElementsByTagName("html")[0];
var original_window_size = root_element.clientWidth;
var original_font_size = root_element.style.fontSize;
function change_font_size(window_size) {
var new_font_size = Math.floor(100 * window_size / original_layout_size);
root_element.style.fontSize = new_font_size + "%";
}

window.onload = function () {
if (original_window_size != original_layout_size) {
change_font_size(original_window_size);
}
};

window.onresize = function () {
var new_window_size = root_element.clientWidth;
change_font_size(new_window_size);
};
stanke je offline   Odgovorite uz citat