我正在为自定义滚动条使用完美的滚动条。它工作正常。
但是滚动条只有在您将鼠标悬停在容器上时才可见。
我如何让这个一直可见?
$('.container').perfectScrollbar();
Run Code Online (Sandbox Code Playgroud)
一旦用户关闭它,我试图隐藏div 24小时.以下代码适用于它.但是如何使用相同的脚本将其设置为90天而不是24小时?
我尝试添加,h*90*24*60*60*1000但它没有用.
任何帮助表示赞赏.
//Get current time
var currentTime = new Date().getTime();
//Add hours function
Date.prototype.addHours = function(h) {
this.setTime(this.getTime() + (h*60*60*1000));
return this;
}
//Get time after 24 hours
var after24 = new Date().addHours(10).getTime();
//Hide div click
$('.cookie_panel > span').click(function(){
//Hide div
$(".divclass").fadeOut();
//Set desired time till you want to hide that div
localStorage.setItem('desiredTime', after24);
});
//If desired time >= currentTime, based on that HIDE / SHOW
if(localStorage.getItem('desiredTime') >= currentTime)
{
$('.divclass').hide();
}
else
{
$('.divclass').show();
}
Run Code Online (Sandbox Code Playgroud)