Bootstrap snippet. news ticker

This Bootstrap snippet. news ticker, was created to help web designers,
front-end developers and back-end developer save time. Use it in your project and build your app faster,
You can also download the HTML, CSS, and JS code.

HTML code

This is the html code used to create this bootstrap snippet, You can copy, paste, change, customize and run the following HTML code to get a result like the one shown in the preview selection


<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

This is the css code used to create this bootstrap snippet, You can copy, paste, change, customize and run the following CSS code to get a result Like the one shown in the preview selection


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

This is the css code used to create this bootstrap snippet, You can copy, paste, change, customize and run the following JS code to get a result Like the one shown in the preview selection


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 snippet social user post

social user post

View

Bootstrap snippet Rounded and Shadowed Alerts

Rounded and Shadowed Alerts

View

Bootstrap snippet Large Blocks With No Space Arrow

Large Blocks With No Space Arrow

View

Bootstrap snippet Bootstrap 3 Control Panel admin dashboard

Bootstrap 3 Control Panel admin dashboard

View

Bootstrap snippet social User Profile and layout

social User Profile and layout

View

Bootstrap snippet Simple Comment panel

Simple Comment panel

View

Bootstrap snippet 404 error page

404 error page

View

Bootstrap snippet To Do List

To Do List

View

Bootstrap snippets. news ticker

About this bootstrap snippet

This bootstrap snippet, news ticker, was published on May 30th 2016, 05:40 by Srinu Sirigiri and it is free.

We hope you will enjoy this awesome snippet and stay tuned for the latest updates, bootdey snippets are already used in thousands of blogs, websites and projects. We believe it will save your precious time and gives trendy look to your next web project.

We always try to offer the best beautiful and responsive source of Bootstrap code examples and components.

This snippet currectly have 3.6K views, Using this bootstrap snippet you have the following benefits:

Bootstrap 3.3.6

This snippet 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 snippet can be simply integrated on existing sites and new ones too, all you need to do is copy the code and start working