Skip to content

API

Events

Smiley Digital comes with a few events that can be used to interact with the panel or how the survey is presented.

Smiley Pop-up

<script type="text/javascript">
  window.HappyOrNot.init({
    token: "token",
    hideOnInit: true
  });
</script>

onEvent

type: function

parameters: toggle

Toggle Smiley Pop-up in our out. Default state can be manipulated with the hideOnInit setting (example above).

// Calling togglePanel, will pop the panel in and out
const togglePanel = window.HappyOrNot.onEvent('toggle');
document.querySelector('button').addEventListener('click', togglePanel);