Bootstrap snippet and html example. news ticker

Bootstrap 3.3.6 snippet "news ticker" with HTML, CSS, and JS. Copy, paste, and customize this responsive UI component for your project.

HTML code

Clean, semantic HTML that powers this Bootstrap 3.3.6 snippet. Copy and paste it into your page (with Bootstrap loaded) to reproduce the exact layout shown in the preview.


<div class="container">
    <div class="holder">
  <ul id="ticker01">
    	<li><a href="#">1 The first thing that most Javascript programmers</a></li>
		<li><a href="#">2 End up doing is adding some code</a></li>
		<li><a href="#">3 The code that you want to run</a></li>
		<li><a href="#">4 Inside of which is the code that you want to run</a></li>
		<li><a href="#">5 Right when the page is loaded</a></li>
		<li><a href="#">6 Problematically, however, the Javascript code</a></li>
		<li><a href="#">7 The first thing that most Javascript programmers</a></li>
		<li><a href="#">8 End up doing is adding some code</a></li>
		<li><a href="#">9 The code that you want to run</a></li>
		<li><a href="#">10 Inside of which is the code that you want to run</a></li>
	</ul>
</div>
</div>




<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script>

CSS code

Scoped CSS that styles the component. Paste it after Bootstrap 3.3.6 to keep the design, spacing, and responsiveness consistent.


body{margin-top:20px;}
.holder { 
  background-color:#ccc;
  width:300px;
  height:300px;
  overflow:hidden;
  padding:10px;
  font-family:Helvetica;
}
.holder .mask {
  position: relative;
  left: 0px;
  top: 10px;
  width:300px;
  height:290px;
  overflow: hidden;
}
.holder ul {
  list-style:none;
  margin:0;
  padding:0;
  position: relative;
}
.holder ul li {
  padding:10px 0px;
}
.holder ul li a {
  color:darkred;
  text-decoration:none;
}

Javascript/Jquery code

Lightweight JS to power any interactions this snippet needs. Drop it under your scripts (after Bootstrap 3.3.6) to mirror the live demo.


jQuery.fn.liScroll = function(settings) {
    settings = jQuery.extend({
		travelocity: 0.03
		}, settings);	
		
		return this.each(function(){
		var $strip = jQuery(this);
		$strip.addClass("newsticker")
		var stripHeight = 1;
		$strip.find("li").each(function(i){
			stripHeight += jQuery(this, i).outerHeight(true); // thanks to Michael Haszprunar and Fabien Volpi
		});
		
		var $mask = $strip.wrap("<div class='mask'></div>");
		var $tickercontainer = $strip.parent().wrap("<div class='tickercontainer'></div>");								
		var containerHeight = $strip.parent().parent().height();	//a.k.a. 'mask' width 	
		$strip.height(stripHeight);			
		var totalTravel = stripHeight;
		var defTiming = totalTravel/settings.travelocity;	// thanks to Scott Waye		
		function scrollnews(spazio, tempo){
		$strip.animate({top: '-='+ spazio}, tempo, "linear", function(){$strip.css("top", containerHeight); scrollnews(totalTravel, defTiming);});
		}
		
		scrollnews(totalTravel, defTiming);				
		$strip.hover(function(){
		jQuery(this).stop();
		},
		function(){
		var offset = jQuery(this).offset();
		var residualSpace = offset.top + stripHeight;
		var residualTime = residualSpace/settings.travelocity;
		scrollnews(residualSpace, residualTime);
		});			
		});	
};

$(function(){
    $("ul#ticker01").liScroll();
}); 

Similar snippets

Bootstrap example and template. Search Results

Search Results

Bootstrap example and template. bs4 sevices page

bs4 sevices page

Bootstrap example and template. Home with images

Home with images

Bootstrap example and template. Dashboard Statistics Overview

Dashboard Statistics Overview

Bootstrap example and template. bs5 dark footer

bs5 dark footer

Bootstrap example and template. zig zag user description

zig zag user description

Bootstrap example and template. Suscribe page with description

Suscribe page with description

Bootstrap example and template. friend zone user list

friend zone user list

FAQ

How do I use this snippet?

Include Bootstrap 3.3.6, paste the HTML, add the CSS block, and include the JS (if any) to mirror the live preview.

Can I use it in commercial projects?

Yes. It’s free for personal and commercial work; check the snippets license for details.

Is it responsive?

Yes. It inherits the responsive grid and components from Bootstrap 3.3.6.

Bootstrap example and template. news ticker

About this bootstrap example/template

Optimized for copy‑paste: clean HTML, scoped CSS, and minimal JS so you can ship production‑ready UI faster and keep designs consistent.

Mobile‑first and responsive by default. Tested across modern browsers to reduce polish time on your project.

Already trusted in 8.5K+ views. Reuse this snippet to speed up landing pages, dashboards, or onboarding flows.

Bootstrap 3.3.6

<link rel='stylesheet' href='https://netdna.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css'>

<script src='https://netdna.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js'></script>

This code example is based on bootstrap 3.3.6 and the grid system of this framework

Responsive

Based on bootstrap framework makes all the layouts perfectly responsive for all devices

Crossbrowser compatibility

Tested on all major browsers, it works smoothly on all of them

Jquery plugins

Great built-in plugins with jquery framework, you can easy to change all declarations

semantic html 5

Built on html / css3 the code quality is really amazing

Simple Integration

This code example can be simply integrated on existing sites and new ones too, all you need to do is copy the code and start working