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

Сообщение от рони
показываем блок(добавляем класс)
<!doctype html>
<html lang="ru">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style type="text/css">
.terms_of_use {
    transform: translateY(-120%);
    position: fixed;
    height: 70px;
    width: 100%;
    background-color: hsla(40, 100%, 30%, 1);
    transition: .8s;
}
.terms_of_use.attention{
    transform: translateY(0%);
    transition-delay: 1s;
}

    </style>

  <script>
window.onload = function(){
    const termsOfUse = document.querySelector(".terms_of_use");
    const iAgree = document.querySelector(".i_agree");

    if (!localStorage.getItem("hidehide")){
        termsOfUse.classList.add("attention");
        iAgree.onclick = function() {
        termsOfUse.classList.remove("attention");
        localStorage.setItem("hidehide", "abrakadabra")
        }
    }
}

</script>

</head>
<body>
<div class="terms_of_use"><button class="i_agree">принять</button></div>
</body>
</html>
Ответить с цитированием