Показать сообщение отдельно
  #5 (permalink)  
Старый 12.05.2009, 19:47
Новичок на форуме
Отправить личное сообщение для johnpro Посмотреть профиль Найти все сообщения от johnpro
 
Регистрация: 12.05.2009
Сообщений: 7

Просмотрел похожий скрипт, добавил из него кусок кода. А как дописать changeWidth и window.onload не знаю.
function changeWidth(){
      currentWidth = parseInt(document.getElementById('test').style.width);
 
      if(currentWidth < 1080){
         currentWidth += 40;
      } else {
         currentWidth = 780;
      }
      document.getElementById('test').style.width = currentWidth + 'px';
   };
     
   function createCookie(name,value,days) {
  if (days) {
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = "; expires="+date.toGMTString();
  }
  else expires = "";
  document.cookie = name+"="+value+expires+"; path=/";
};

function readCookie(name) {
  var nameEQ = name + "=";
  var ca = document.cookie.split(';');
  for(var i=0;i < ca.length;i++) {
    var c = ca[i];
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
  }
  return null;
};
 
   window.onload = function(){      
     document.getElementById('test').style.width = '780px';
       }
Ответить с цитированием