Solved

I want a news bar like this one?

Posted on 2006-06-09
2
214 Views
Last Modified: 2008-03-06
Hi...
for two weeks i have been searching for a good  news bar.
but i coudn't find anything interesting .. i have searched in dynamicdrive.com and found some bars but they were no good.

today i was browsing the Internet and i found this cool news bar in this website:
http://www.sana.org/index_eng.html
can anyone provied me with this news bar if it's Free or it's cost?

Thank you.
0
Comment
Question by:fayezsaad
2 Comments
 
LVL 5

Accepted Solution

by:
shaggy_the_sheep earned 50 total points
Comment Utility
Hi

That should be quite easy to code for.

First create the <div> you would like to house your news bar

<div id="newsBar" style="width: 400px; height: 100px; color: white; background-color: blue"></div> (Of course you can change the appearance and positon of your div, just ensure it still has the id 'newsBar')

Now for the function to fill the newsbar

within your <script> tags insert this function
var msg = 'Hello here is an example of today\'s news!'
var typeLen = 1000; //This is the amount of time you want between the addition of characters, measured in milliseconds.
var showLen = 3000; //This is the amount of time you want the news item to be show after the final character is written, measured in milliseconds.
//Note that you have to 'escape' special characters such as apostrophes with a forward slash.

var timer; function showNews(pos){

var showNews = msg.substring(0,pos)
document.getElementById('newsBar').innerHTML = showNews;

newPos = pos + 1;

if(newPos<=msg.length){
   clearTimeout(timer);
   timer = setTimeout('showNews(newPos)',typeLen)
   }
else{
   clearNews();
   }
}
var timer1; function clearNews(){

document.getElementById('newsBar').innerHTML = '';

clearTimeout(timer1);
timer1 = setTimeout('showNews(1)',showLen)

}

Let me know if you get any problems

Richard
0
 

Author Comment

by:fayezsaad
Comment Utility
Thanks alot shaggy_the_sheep
Its cool
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
date format angularjs2 16 36
Detecting robots? 5 34
Phone Dialer 5 36
JSOM: The collection has not been initialized. 5 22
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now