@Kostyaiii92

Есть код Preloader на сайт, как сделать чтобы он показывался 1 раз?

Добрый день.
В js почти не разбираюсь, но потихоньку учусь ))
У меня есть код Прелоадера. Как сделать чтобы Прелоадер показывался 1 раз ? а не после каждого перехода по страницам )
Как правильно дополнить код ?
<!-- HelloPreload http://hello-site.ru/preloader/ -->
<style type="text/css">
#hellopreloader>p{display:none;}
#hellopreloader_preload{display: block;position: fixed;z-index: 99999;
top: 0;
left: 0;
width: 100%;
height: 100%;
min-width: 1000px;
background: #2C3E50 url(http://hello-site.ru//main/images/preloads/circles.svg) center center no-repeat;background-size:82px;}
</style>
<div id="hellopreloader">
<div id="hellopreloader_preload"></div>
<p><a href="http://hello-site.ru">Hello-Site.ru. Бесплатный конструктор сайтов.</a></p></div>
<script type="text/javascript">var hellopreloader = document.getElementById("hellopreloader_preload");
function fadeOutnojquery(el){el.style.opacity = 1;
var interhellopreloader = setInterval(function(){el.style.opacity = el.style.opacity - 0.05;
if (el.style.opacity <=0.05){ clearInterval(interhellopreloader);
hellopreloader.style.display = "none";}},16);}window.onload = function(){setTimeout(function(){fadeOutnojquery(hellopreloader);},1000);};
</script>
<!-- HelloPreload http://hello-site.ru/preloader/ -->


ТАКЖЕ ЕСТЬ ЕЩЕ ВОТ ТАКОЙ КОД:

<style type="text/css">#hellopreloader>p{display:none;}#hellopreloader_preload{display: block;position: fixed;z-index: 99999;top: 0;left: 0;width: 100%;height: 100%;min-width: 1000px;background: #C0392B url(http://hello-site.ru//main/images/preloads/oval.svg) center center no-repeat;background-size:76px;}</style>

<div id="hellopreloader">
<div id="hellopreloader_preload">
</div>
</div>
<script type="text/javascript">var hellopreloader = document.getElementById("hellopreloader_preload");
function fadeOutnojquery(el){el.style.opacity = 1;
var interhellopreloader = setInterval(function(){el.style.opacity = el.style.opacity - 0.05;if (el.style.opacity <=0.05){ clearInterval(interhellopreloader);
hellopreloader.style.display = "none";}},16);}window.onload = function(){setTimeout(function(){fadeOutnojquery(hellopreloader);},1000);};</script>
  • Вопрос задан
  • 428 просмотров
Пригласить эксперта
Ответы на вопрос 2
@usikovartem
люблю играть в раст
нет нету
Ответ написан
Комментировать
Toxa26
@Toxa26
Студент. Люблю верстать сайты.
Можете посмотреть этот вариант решения проблемы: Как сделать так, что бы Preloader показывался один раз?
Лично в моей ситуации не сработало, но вам может помочь...
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы