Advertisement
makapoh

Autoresize

Jul 29th, 2013
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function autosize(width) {
  2.     if (typeof VK.callMethod != 'undefined') {
  3.         VK.callMethod('resizeWindow', width, document.getElementById('body').clientHeight + 60);
  4.         return;
  5.     }
  6.     VK.init(function(){
  7.         /*
  8.         Вызываем функцию vk js api для управления окном.
  9.         VK.callMethod('функция', параметры)
  10.         В данном случае у нас - VK.callMethod('изменение_размеров_окна', ширина, высота);
  11.         Так же добавляем еще 60 пикселей что бы было небольшое расстояние.
  12.         */
  13.         VK.callMethod('resizeWindow', width, document.getElementById('body').clientHeight + 60);
  14.     }, function(){
  15.         console.error('error #2');
  16.     });
  17. }
  18. $(function(){
  19.     setInterval('autosize(1000)', 1000);
  20. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement