Skip to content

JavaScript object to determine if a pop-up chat window is open as the user browses through a site.

License

Notifications You must be signed in to change notification settings

calebtr/chatOpen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

chatOpen

Uses JavaScript localStorage to determine if a slide-out chat window is open as the user browses a site.

Use:

  • chatOpen.getStatus();
  • chatOpen.setStatus(boolean);
  • chatOpen.toggleStatus();

Example (uses jQuery):

<script type ="text/Javascript">
  $('#chat-header').click(function() {
    $('#chat-wrapper').toggle();
    chatOpen.toggleStatus();
  });

  if (chatOpen.getStatus()) {
    $('#chat-wrapper').show();
  }
</script>

<div>
  <div id="#chat-header">Chat header</div>
  <div id="#chat-wrapper" style="display: none;">Chat Widget</div>
</div>

About

JavaScript object to determine if a pop-up chat window is open as the user browses through a site.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published