2

I know you can user session storage to only display an onload modal once. Not sure on syntax or where to add it.

<script type="text/javascript">
    $(window).on('load', function() {
    $('#featureGuide').modal('show');
    });
</script>
Jorden
  • 19
  • 6
  • https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage#Example – Pete Sep 09 '19 at 10:01
  • Possible duplicate of [Display Bootstrap Modal First time page loads](https://stackoverflow.com/questions/16596429/display-bootstrap-modal-first-time-page-loads) – 4b0 Sep 09 '19 at 10:17

1 Answers1

2

Set the value in local storage after login (Or when you want to show).

<script type="text/javascript">
  $(window).on('load', function() {
    var modelShown = localStorage.getItem('modelShown');
    if(modelShown != 'YES'){
      $('#featureGuide').modal('show');
      localStorage.setItem('modelShown', 'YES');
    }
  });
</script>

Clear the local storage on logout.

localStorage.removeItem('modelShown');
Alok Mali
  • 2,821
  • 2
  • 16
  • 32
  • 1
    Perfect, thanks! I actually decided to use session storage rather than local storage but works the same :) – Jorden Sep 09 '19 at 10:20