Solved

I want a news bar like this one?

Posted on 2006-06-09
2
215 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
ID: 16874114
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
ID: 16877802
Thanks alot shaggy_the_sheep
Its cool
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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…

895 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

12 Experts available now in Live!

Get 1:1 Help Now