sessonStorage refresh splashscreen
sessonStorage refresh splashscreen
我正在制作一个防溅屏。单击箭头(类别.fa-nagle-up
)后,防溅屏将消失。但当我刷新页面时,splashscreen消失了,这有点像display:none
。
CSS
.splashscreen{
position: absolute;
width:100%;
height:100%;
overflow:hidden;
z-index:100000;
display: flex;
flex-direction: column;
display: none;
}
JS
if (sessionStorage.getItem('splash') !== 'true') {
$('.splashscreen').show();
sessionStorage.setItem('splash','true');
}
$('.splashscreen .top .fa-angle-up').on('click',function(){
$('.splashscreen').hide();
});
如何使防溅屏在刷新后不会消失?
我无法发表评论,但这应该会在刷新后保留splashscreen,但一旦设置了sessionStorage,splashscreen将不会显示。
var splash = sessionStorage.getItem('splash');
init();
function init() {
if (splash !== 'true') {
$('.splashscreen').show();
sessionStorage.setItem('splash','true');
}
else {
$('.splashscreen .top .fa-angle-up').on('click',function(){
$('.splashscreen').hide();
});
}
}
相关文章:
- sessonStorage refresh splashscreen
- Refresh iframe?
- jQuery Refresh Captcha正在重新加载页面
- AJAX/page refresh kills JS/jQuery
- angular google maps TypeError:$scope.map.control.refresh不是函数
- Cordova(Ionic):Splashscreen只在Android上运行一次
- JavaScript: ΔURL, Refresh
- 如何隐藏PhoneGap Android SplashScreen
- 科尔多瓦使用SplashScreen插件在另一个文件夹中查找cordova_plugins.js
- Rails 3.2 Coffeescript to Refresh Div using Ajax - 重新加载整个页面
- Javascript refresh() method
- Ajax refresh for telerik radgrid
- 防止 OnBeforeUnload() 事件在 refresh/F5 中发生
- HTTP-EQUIV="REFRESH" conflict with window.location
- Jquery .span refresh onclick
- DevExpress DateEdit refresh
- jQuery PHP gallery with page refresh
- JQuery Onload refresh iframe
- 如何在iphone/android上显示splashscreen
- DevExpress MVC GridView refresh