Solved

I want a news bar like this one?

Posted on 2006-06-09
2
219 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
This article discusses how to create an extensible mechanism for linked drop downs.
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…
Suggested Courses

751 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