[Javascript] How to enlarge and small the font
时间:2010-08-17 来源:DavidHHuan
html code:
代码<a href="####" id="zoom_minify">Zoom In</a>
<a href="####" id="zoom_magnify">Zoom Out</a>
js code:
代码<script type="text/javascript">
$('#zoom_minify').click(function(){
textZoom(-1);
});
$('#zoom_magnify').click(function(){
textZoom(1);
});
function textZoom(i){
var newSize = Number($('body').css('font-size').substring(0, $('body').css('font-size').length-2)) + i;
$('body').css('font-size', newSize);
}
</script>
相关阅读 更多 +