default frame size

This commit is contained in:
Vadim Makeev 2010-11-11 11:49:07 +03:00
parent 3920e599f4
commit c2bc76b3da
1 changed files with 7 additions and 4 deletions

View File

@ -35,11 +35,14 @@
</style> </style>
<script> <script>
function update() { function update() {
var url = document.location.hash.substr(1).split('x'), var url = document.location,
hash = url.hash.substr(1).split('x');
frame = document.querySelector('iframe'); frame = document.querySelector('iframe');
if(url.length == 2) { if(hash.length == 2) {
frame.style.width = url[0] + 'px'; frame.style.width = hash[0] + 'px';
frame.style.height = url[1] + 'px'; frame.style.height = hash[1] + 'px';
} else {
url.hash = '640x480';
} }
} }
function init() { function init() {