When a user closes a
, hide that
on all site pages

前端 未结 12 874
忘了有多久
忘了有多久 2020-12-15 02:49

I\'ve developed a couple of alert boxes that display on all site pages.

The user is able to close each box separately:

12条回答
  •  無奈伤痛
    2020-12-15 03:41

    It possible to that with sessionStorage of javascript.

    For exemple :

    Storage the current date ( var currentDate) and date after one minute (var afterOneMinute)in sessionStorage. Each click on a button or reload page, change current date and compare them with afterOneMinute variable and after hide or show box

    html File

    
        
    
    
    
    

    Box

    hello

    JS

    
    

提交回复
热议问题