always fit browser width

This commit is contained in:
Sanj 2011-06-25 01:47:05 +05:30
parent 3c07a6228d
commit 421581eadb

View File

@ -2,6 +2,15 @@
$(function() {
$(window).resize(function() {
var svgAspect = 1220 / 560;
var windowWidth = $(window).width();
var svgWidth = windowWidth - 20;
var svgHeight = parseInt(svgWidth / svgAspect);
$('svg').attr("width", svgWidth);
$('svg').attr("height", svgHeight);
});
$(window).resize();
$.getJSON("radia.json", {}, function(data) {
var R = data;
var $texts = [];