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
Solved

I want a news bar like this one?

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
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…

856 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