Simple Live Commenting Plugin With jQuery - nncomment.js

File Size: 3.34 KB
Views Total: 4026
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   
Simple Live Commenting Plugin With jQuery - nncomment.js

nncomment.js is a minimal jQuery plugin which shows scrolling user comments and live chat messages on any elements.

How to use it:

1. Add the jQuery nncomment.js script to the webpage after you've added jQuery JavaScript library.

<script src="//code.jquery.com/jquery-1.12.1.min.js"></script>
<script src="nncomment.js"></script>

2. Add a comment/chat form to your webpage like this:

<form id="comment" action="#">
  <div id="screen" class="nnc-screen">
  </div>
  <input id="message">
</form>

3. Active the live commenting system.

$(function() {
  $('#comment').on('submit', function() {
    var message = $('#message').val();
    $('#message').val('');
    $('#screen').comment(message);

    return false;
  });
});

4. Style the live commenting system.

.nnc-screen {
  position: relative;
  overflow: hidden;
}

.nnc-comment {
  position: absolute;
  white-space: nowrap;
}

This awesome jQuery plugin is developed by wmoai. For more Advanced Usages, please check the demo page or visit the official website.