1

Looking to configure featherlight.js to show only once per user (ie. if user loads the page again they will not see it). With thanks, Cas.

afroduck
  • 143
  • 8

1 Answers1

1

Colleague found a solution...

welcomeLightbox: function () {
    'use strict';
    if ($.cookie('welcomeLightboxShown') == null) {
      $.featherlight($('#mylightbox'), {});
    }
    $('.featherlight-close').click(function() {
      // $.cookie('welcomeLightboxShown', 'true', { path: '/' });
      $.cookie('welcomeLightboxShown', 'true', { expires: 365, path: '/' });
    });
  },
afroduck
  • 143
  • 8
  • Ok solution. Best to use the `afterClose` callback to set the cookie, though. If the user presses escape, for instance, your code won't set the cookie. – Marc-André Lafortune Dec 13 '17 at 23:24