Показать сообщение отдельно
  #11 (permalink)  
Старый 14.01.2016, 15:33
Аватар для рони
Профессор
Отправить личное сообщение для рони Посмотреть профиль Найти все сообщения от рони
 
Регистрация: 27.05.2010
Сообщений: 33,103

cookie сохранить состояние таблицы на неделю
Castromen,
кука на неделю
<!DOCTYPE HTML>

<html>

<head>
  <title>Untitled</title>
  <meta charset="utf-8">
  <style type="text/css">
  td{
    height: 45px;
     border: 1px solid #0000FF;
     transition: all .8s ease-in-out;
  }

  .hide td:nth-child(1){
     display: none;
  }
  .hide td:nth-child(2){
      width: 1185px;
      background-color: #1E90FF;
  }
  table{
  border-collapse: collapse;
  }

  </style>
</head>

<body>
<table border="0" class="ms-pub-contentLayout ms-verticalAlignTop">
 <tr>
 <td valign="top" width="300px"> </td> <!--скрыть при нажатие -->
 <td valign="top" width="885px"> </td>
 </tr>
 </table>
 <button class="btn btn-success active" type="button"><span class="glyphicon glyphicon-th-list"></span>
Скрыть/Развернуть</button>
<script>
window.addEventListener("DOMContentLoaded", function() {
    var b = document.querySelector(".btn-success"),
        c = document.querySelector(".ms-pub-contentLayout");
    b.addEventListener("click", function(a) {
        a.preventDefault();
        c.classList.toggle("hide");
        a = c.classList.contains("hide");
        var b = new Date((new Date).getTime() + 6048E5);
        document.cookie = "hide=" + a + "; path=/; expires=" + b.toUTCString()
    });
    "true" === function(a) {
        return (a = document.cookie.match(new RegExp("(?:^|; )" + a.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, "\\$1") + "=([^;]*)"))) ?
            decodeURIComponent(a[1]) : void 0
    }("hide") && b.click()
});
</script>
</body>

</html>
Ответить с цитированием