.
<!--"размер шрифта" -->
<style id=a_fnt>.post h3 img{margin:0 7px;cursor:pointer;}</style>
<script type="text/javascript">
function setcookieF(a,b,c){if(c){var d=new Date();d.setTime(d.getTime());d=new Date(d.getTime()+c)}if(a&&b)document.cookie=a+'='+b+(c?'; expires='+d.toGMTString():'');else return false}function getcookieF(a){var b=new RegExp(a+'=([^;]){1,}');var c=b.exec(document.cookie);if(c){c=c[0].split('=')}else{return false}return c[1]?c[1]:false}
a='<strong class=fnt style="width:auto;margin-right:28%;"><img src="http://www.iconsearch.ru/uploads/icons/blandet/16x16/bullet_toggle_minus.png" alt="-" />размер шрифта<img src="http://www.iconsearch.ru/uploads/icons/silk2/16x16/bullet_toggle_plus.png" alt="+" /></strong>';$(".post:first h3 strong,.post:last h3 strong").after(a);
b_Fnt1='<style id=b_fnt>#main-reply,.punbb .post-content{font-size:';b_Fnt2='px;}</style>'
var c_Fnt;
N=getcookieF('c_Fnt')
if(N){c_Fnt=parseFloat(N);setcookieF('c_Fnt',c_Fnt,30*24*60*60*1000)}else{var c_Fnt=Math.round(parseFloat($(".punbb .post-content").css("font-size")));}
b_Fnt=b_Fnt1+c_Fnt+b_Fnt2; $("#a_fnt").after(b_Fnt);
function setFnt_Size(){
b_Fnt=b_Fnt1+c_Fnt+b_Fnt2;
$("#b_fnt").replaceWith(b_Fnt);//alert(b_Fnt)
setcookieF('c_Fnt',c_Fnt,30*24*60*60*1000);
}
$(".post h3 img[alt='-']").click(function (){if(c_Fnt){c_Fnt--;setFnt_Size();}});
$(".post h3 img[alt='+']").click(function (){if(c_Fnt<38){c_Fnt++;setFnt_Size();}});
</script>
Отредактировано sleven celebra (2015-05-21 17:03:34)