Click here to Skip to main content
15,886,519 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am looking for the news ticker example for my web page .through java script and jquery. i have to bind some news with " li " .. i want my news ticker like down to up. please find my solution.
Posted
Updated 25-Feb-13 21:27pm
v3
Comments
OriginalGriff 26-Feb-13 3:25am    
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
Use the "Improve question" widget to edit your question and provide better information.

1 solution

Well, I have create my own in my news website.

JavaScript/jQuery Code
JavaScript
<script type="text/javascript" language="javascript">
var c = 0;
function ticker(){
	c++;
	$(document).ready(function(){
		$(".news-ticker ul li").each(function(){
			$(this).fadeOut('slow');
		});
		$("#n" + c).fadeIn('slow');
	});
	if( c >= 5)
		c =0;
		
	setTimeout('ticker()', 5000);
}
setTimeout('ticker()', 1);
</script>



HTML Code
HTML
<div class="news-ticker">
  <ul>
    <li id="n1"><a href="new-link">News Title 1</a></li>
    <li id="n2"><a href="new-link">News Title 2</a></li>
    <li id="n3"><a href="new-link">News Title 3</a></li>
    <li id="n4"><a href="new-link">News Title 4</a></li>
    <li id="n5"><a href="new-link">News Title 5</a></li>
  </ul>
</div>


Also here is a plugin for jQUery News Ticker
 
Share this answer
 
Comments
amitkumar5734 26-Feb-13 4:40am    
shows the error when i have applied your code on my page error :- the class or cssclass is not defined.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900