Solved

I want a news bar like this one?

Posted on 2006-06-09
2
220 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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
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

617 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