Simple News Ticker/Scroller Plugin with jQuery - Smart Marquee

File Size: 29.7 KB
Views Total: 21808
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   
Simple News Ticker/Scroller Plugin with jQuery - Smart Marquee

Smart Marquee is a simple lightweight jQuery plugin which allows you to scroll through a list of items vertically or horizontally like the abandoned marquee element. Useful for news ticker, text/image scroller and many others.

How to use it:

1. Load the jQuery library and the jQuery smart marquee plugin in the document.

<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="jquery.smartmarquee.js"></script>

2. Create a list of items for the news ticker/scroller.

<div class="smartmarquee example">
  <ul class="container">
    <li> Item 1 </li>
    <li> Item 2 </li>
    <li> Item 3 </li>
    <li> Item 4 </li>
    <li> Item 5 </li>
    <li> Item 6 </li>
  </ul>
</div>

3. The required CSS styles.

.smartmarquee {
  position: relative;
  overflow: hidden;
}

.smartmarquee .container { position: absolute; }

4. Call the plugin on the parent element and config the options for the news ticker/scroller.

$(document).ready(function () {
  $(".example").smartmarquee({

  // animate duration
  duration: 1000,   
  
  // auto loop
  loop : true,      
  
  // interval duration
  interval : 2000, 
  
  // 'vertical' or 'horizontal'
  axis : "vertical", 

  });
});

Change log:

2014-12-05

  • Update jquery.smartmarquee.js

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