CNN-style Interactive News Ticker (HTML5/CSS3)
Posted by bcmoney on June 22, 2012 in CSS, E-Business, HTML, Semantic Web with No Comments
With the real, true and unbiased news inevitably moving online towards the so-called “Alternative Media” (which really is almost reaching the point where it is not alternative so much as the first go-to source), its a good idea to start replicating some of the most useful elements from Television, Print and Radio (aka. the rest of the dinosaur media).
The CNN News Ticker Tape is a somewhat controversial item, as it is considered annoying by many. However, in terms of being able to quickly get information across the screen without interrupting another presentation, it is arguably somewhat effective. Proponents of its use claim it is the best way to get instant updates while maintaining a coherent programming schedule, while critics point to its potential for misuse and indoctrination of the weak-minded with subliminal messages flashing across the screen or fear-mongering sensationalism so common in the “Mainstream Media” today.
Taking the bad and the good into consideration, I’ve thrown together a mock-up that could function somewhat similarly to the Semantically Enhanced Video Pop-ups I’ve implemented using Popcorn.js and to replicate the VH1 Pop-up Video effect. You could imagine having the usefulness of having contextual content being inferred based on the content being viewed, or, simply populating a basic news ticker with the entries from an existing RSS or Atom news feed to link to the day’s top stories.
This becomes much more interactive and responsive than Traditional TV News Tickers as they can be paused on hover actions, offer more information by making stories clickable to popup a new window or displaying an article in-page, and have fonts/typography/colors/scroll speed and many other settings which are configurable and customizable for specific users, let alone specific TV channels.
<body onload="setClock(); setInterval('setClock()', 1000)">
<h1>Interactive Ticker/Scroller</h1>
<div id="tv">
<div id="screen">
<a href="#" onclick="playVideo();"><img src="http://frankpaulgambino59.files.wordpress.com/2011/03/cnn-best-political-team-in-television.jpg" alt="CNN Newsroom scene" /></a> </div>
<div id="ticker">
<div class="newsflash">
<div class="slant1" style="width:7em;"></div>
<div class="slant2" style="width:7em;"></div>
<p>
Arab spring, under the protests many suffered and unfortunate fate at the hands of brutal...
</p>
</div>
<div id="logo">
<a href="http://www.cnn.com" target="_blank"><img src="http://upload.wikimedia.org/wikipedia/commons/thumb/8/8b/Cnn.svg/201px-Cnn.svg.png" width="75px" alt="CNN" />
</div>
<div id="scroller">
<marquee id="scrolling" onmouseover='this.scrollamount=0; this.stop();' onmouseout='this.scrollamount=5; this.start();'>
<ul>
<li><a href="#1">News in the key of nonsense</a></li>
<li><a href="#2">Man with 3 arms has baby with no head</a></li>
<li><a href="#3">Silver-screen has never looked greyer</a></li>
<li><a href="#4">Wall Street kingpin's empire burns amid corruption charges</a></li>
<li><a href="#5">We're doing our best to ignore Ron Paul, but now you see right through it!</a></li>
</ul>
</marquee>
</div>
<div id="time">
<span id="clock"> </span>
</div>
</div>
</div>
</body>
The CSS to style the presentation looks as follows:
div#ticker {
font-family:'Arial Narrow', Arial, 'Courier New', Courier, serif;
font-weight:bold;
width:580px;
border-top:2px solid red;
margin:-65px auto;
background:black;
/* Fallback for web browsers that don't support RGBa */
background-color: rgb(0, 0, 0);
/* RGBa with 0.6 opacity */
background-color: rgba(0, 0, 0, 0.6);
/* For IE 5.5 - 7*/
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000);
/* For IE 8*/
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000)";
opacity:0.9;
filter:Alpha(opacity=90); /* IE8 and earlier */
}
/* Logo */
div#logo {
float:left;
position:absolute;
padding:10px;
width:75px;
z-index:1000001;
background:black;
color:red;
text-shadow:#506 2px 2px 2px;
}
div#logo img { opacity:1; filter:Alpha(opacity=100); }
div#scroller {
float:left;
overflow:hidden;
}
/* Ticker */
div#scroller marquee {
position:absolute;
z-index:1000000;
width:578px;
margin:30px 2px 2px 2px;
padding:20px -1px 20px 75px;
font-size:1.4em;
font-weight:bold;
font-family:Arial, 'Courier New', Courier, serif;
text-transform:uppercase;
color:red';
background:black;
/* Fallback for web browsers that don't support RGBa */
background-color: rgb(0, 0, 0);
/* RGBa with 0.6 opacity */
background-color: rgba(0, 0, 0, 0.6);
/* For IE 5.5 - 7*/
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000);
/* For IE 8*/
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000)";
opacity:0.9;
filter:Alpha(opacity=90); /* IE8 and earlier */
}
div#scroller marquee ul { list-style-type:circle; }
div#scroller marquee li { float:left; padding:0 32px 0 8px; }
div#scroller marquee a { color:goldenrod; text-shadow:#ccf 1px 1px 1px; }
/* Clock */
div#time {
float:right;
width:578px;
text-align:right;
color:#fff;
position:absolute;
padding:2px 10px 8px 2px;
background:black;
/* Fallback for web browsers that don't support RGBa */
background-color: rgb(0, 0, 0);
/* RGBa with 0.6 opacity */
background-color: rgba(0, 0, 0, 0.6);
/* For IE 5.5 - 7*/
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000);
/* For IE 8*/
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000)";
opacity:0.9;
filter:Alpha(opacity=90); /* IE8 and earlier */
}
/* Newsflash hover */
div.newsflash {
display:none;
position:absolute;
top:400px;
background:white;
color:black;
margin:1em auto;
padding:0;
width:580px;
text-align:center;
border-bottom:1px solid #eee;
background:black;
/* Fallback for web browsers that don't support RGBa */
background-color: rgb(0, 0, 0);
/* RGBa with 0.6 opacity */
background-color: rgba(0, 0, 0, 0.6);
/* For IE 5.5 - 7*/
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000);
/* For IE 8*/
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000)";
opacity:0.9;
filter:Alpha(opacity=90); /* IE8 and earlier */
}
div.slant1 {
background:transparent;
height:0;
border-style:solid none none solid;
border-color:black black black white;
border-width:2em 1em;
margin:0 0 0 0.5em;
padding:0;
float:right;
clear:right;
opacity:0.7;
filter:Alpha(opacity=70); /* IE8 and earlier */
}
div.slant2 {
background:transparent;
height:0;
border-style:solid solid none none;
border-color:black white black white;
border-width:2em 1em;
margin:0 0.5em 0 0;
padding:0;
float:left;
clear:left;
opacity:0.7;
filter:Alpha(opacity=70); /* IE8 and earlier */
}
The JavaScript to handle any interactive behaviours or events is:
function setClock() {
var today = new Date();
var currentHours = today.getHours();
var currentMinutes = today.getMinutes();
var currentSeconds = today.getSeconds();
// Pad the minutes and seconds with leading zeros, if required
currentMinutes = ( currentMinutes < 10 ? "0" : "" ) + currentMinutes;
currentSeconds = ( currentSeconds < 10 ? "0" : "" ) + currentSeconds;
var timeOfDay = ( currentHours < 12 ) ? "AM" : "PM"; // Use "AM" or "PM" depending on time of day
// Convert the hours component to 12-hour format
currentHours = ( currentHours > 12 ) ? currentHours - 12 : currentHours;
currentHours = ( currentHours == 0 ) ? 12 : currentHours; // Convert millitary hours to "0" to "12"
// Compose the string for display
var currentTime = currentHours + ":" + currentMinutes + ":" + currentSeconds + " " + timeOfDay;
console.log(currentTime + ' ' + document.getElementById("clock").innerHTML);
document.getElementById("clock").innerHTML = currentTime;
}
function playVideo() {
document.getElementById('screen').innerHTML = ''; return false;
}
As usual, you can try out a demonstration or download the source of this prototype below:
In Conclusion, hopefully a more interactive, user-controllable and customizable news ticker for the web and online video becomes more useful (and less sinister) than the one we’ve had thrust upon us on TV.
Related Articles
- IDEA: A Smarter Sports News Ticker (levynewsnetwork.wordpress.com)
- You Can’t Escape the Facebook News Ticker Anymore (labnol.org)
- Hate the Facebook News Ticker? Some Can Now Hide It (readwriteweb.com)
- A News Ticker For Your Desktop (ghacks.net)
- Retickr Updates with a Better Interface, Time Sliders, and More [Mac Downloads] (lifehacker.com)
- Retickr turns your RSS feed into a desktop news ticker (venturebeat.com)

You may follow the RSS 2.0 feed. You can leave a response or a trackback.
Leave a Reply
No trackbacks yet.
Posts with similar tags
- iScroll with HTML5 Video and Pause/Resume
iScroll 4 is the latest version and release of an excellent content slider-type JavaScript component by Matteo Spinelli. While one may argue that content sliders are a dime a dozen, iScroll differs in the fact that it has full support for all the main WebKit for iOS gestures including pinch/zoom, pull-up/pull-down, smooth scrolling and screen... - Parser for XMLTV format and SchedulesDirect data
For a long time now, I've been a paying customer of SchedulesDirect, and by that token their parent company Zap2it (now a Tribune Media Services company).
Recently, I've started publishing my own personal Electronic Programming Guide (EPG) here on BCmoney MobileTV in an accessible format:
BC$ EPG
One of the secondary goals of my MobileTV project has...
Posts in similar categories
- The Most Meaningful Use of EHR in Health Care
I've been thinking a lot about ways that Health Care and the medical system in general can be improved through the use of IT. In the United States right now, we are over 1 year into the so-called "Meaningful Use" guidelines established by the Health Information Technology for Economic and Clinical Health (HITECH) Act of... - Semantic Web and LinkedData Explained For The Lay Person
The Semantic Web is beginning to gain steam along with the related (but separate) NoSQL and BigData movements; but what is the Semantic Web (commonly abbreviated "SW")? The term itself sounds like some uber geek-speak and turns off most people without a technical background and appreciation of web evolution almost immediately after hearing it. However,... - SkipSearch ALPHA released
The ALPHA version of SkipSearch has been released!!!
SkipSearch is a proprietary front-end to OpenRecommender, an open source recommendation engine. Its primary features include:
Easy-to-use Interface with hover-intent to reduce clicks, audio controls & shortcuts
Lightweight HTML5 / CSS3 layout
Mobile-friendly, responsive design
Schema.org properties and support for RDFa/Microformats
Import data from multiple accounts (Google/Yahoo/Microsoft/Twitter/Facebook/LinkedIN/Last.FM/StumbleUpon and other social media account integration)
Export functionality... - My Experiment in Cutting Cords (and costs) with VoIP
Like most Canadians, I have paid way more than I care to admit to the greedy Telcos over the past several years. My estimates put my average monthly bill for two smartphone plans and a home telephone line with an international long-distance plan at approximately $175/month (some months higher, some months lower, but that's the... - Top 10 Finish in MintChip Challenge: THANK YOU!
It is with great humility and gratitude that I announce that I have finished in the Top 10 of the Mintchip Challenge with my proposed application and idea that "A digital currency can be used for P2P barter and micropayments".
You can see the full list of finalists in the Mintchip Challenge here:
http://ideas.mintchipchallenge.com/
There were really some... - P2P Barter – My entry to the MintChip Challenge
Here's an explanation of what we have today, followed by a Use-Case for my idea...
TODAY:
1. Person A is a farmer who has worked hard all season and is ready for harvest of their crops. For simplicity's sake, let's call him the "Seller", since the next step will be to sell their produce. For that they... - FOAF and the Facebook Death Star
Since the February confirmation of the Facebook IPO, Facebook has continued to stagnate in user-base yet as an organization it holds no punches as it attempts to grow internationally, and its stock price continues to soar as Class A shares finally open up to the average person (major investment firms had first dibs at the... - Unboxing the MintChip
The Royal Canadian Mint(RCM) has sponsored the MintChip Challenge 2012 in an effort to attract developers to the idea of developing software for the MintChip and giving away their best financial application ideas, basically, for free (on the long-shot that you are one of the few who win).
Starting April 1st, 2012, they began mailing out... - Popcorn.js + Embedded Video = Semantically Enhanced Video Content
Popcorn.js is an incredibly useful framework for adding timing-based events and/to Semantic metadata to rich content.
According to Mozilla: "Popcorn makes video work like the web. We create tools and programs to help developers and authors create interactive pages that supplement video and audio with rich web content, allowing your creations to live and grow online."
With... - Distinguish Between Venture Debt and Venture Capital
If you are an entrepreneur, you might often get confused about when to raise venture capital as against venture debt. This is because these two words have very thin
margin of convergence which raises the misconceptions in the first place. The basic difference between venture debt and venture capital is that the debt you have taken...
BC$ = Behavior, Content, Money
The goal of the BC$ project is to raise awareness and make changes with respect to the three pillars of information freedom - Behavior (pursuit of interests and passions), Content (sharing/exchanging ideas in various formats), Money (fairness and accessibility) - bringing to light the fact that:
1. We regularly hand over our browser histories, search histories and daily online activities to companies that want our money, or, to benefit from our use of their services with lucrative ad deals or sales of personal information.
2. We create and/or consume interesting content on their services, but we aren't adequately rewarded for our creative efforts or loyalty.
3. We pay money to be connected online (and possibly also over mobile), yet we lose both time and money by allowing companies to market to us with unsolicited advertisements, irrelevant product offers and unfairly structured service pricing plans.
Archives
- April 2013
(1 posts)
- March 2013
(1 posts)
- February 2013
(1 posts)
- January 2013
(1 posts)
- December 2012
(1 posts)
- November 2012
(2 posts)
- October 2012
(1 posts)
- September 2012
(1 posts)
- August 2012
(1 posts)
- July 2012
(2 posts)
- June 2012
(1 posts)
- May 2012
(1 posts)
- April 2012
(1 posts)
- March 2012
(1 posts)
- February 2012
(1 posts)
- January 2012
(2 posts)
- December 2011
(1 posts)
- November 2011
(1 posts)
- October 2011
(1 posts)
- September 2011
(1 posts)
- August 2011
(1 posts)
- July 2011
(1 posts)
- June 2011
(1 posts)
- May 2011
(2 posts)
- April 2011
(2 posts)
- March 2011
(1 posts)
- February 2011
(1 posts)
- January 2011
(1 posts)
- December 2010
(3 posts)
- November 2010
(1 posts)
- October 2010
(1 posts)
- September 2010
(2 posts)
- August 2010
(1 posts)
- July 2010
(1 posts)
- June 2010
(1 posts)
- May 2010
(1 posts)
- April 2010
(1 posts)
- March 2010
(1 posts)
- February 2010
(1 posts)
- January 2010
(1 posts)
- December 2009
(1 posts)
- November 2009
(1 posts)
- October 2009
(1 posts)
- September 2009
(1 posts)
- August 2009
(1 posts)
- July 2009
(1 posts)
- June 2009
(1 posts)
- May 2009
(1 posts)
- April 2009
(1 posts)
- March 2009
(1 posts)
- February 2009
(1 posts)
- January 2009
(1 posts)
- December 2008
(1 posts)
- November 2008
(2 posts)
- October 2008
(1 posts)
- September 2008
(2 posts)
- August 2008
(1 posts)
- July 2008
(2 posts)
- June 2008
(3 posts)
- May 2008
(3 posts)
- April 2008
(4 posts)
- March 2008
(6 posts)
- February 2008
(6 posts)
- January 2008
(8 posts)
- December 2007
(7 posts)
- November 2007
(1 posts)
- October 2007
(1 posts)
- February 2007
(2 posts)
- September 2006
(1 posts)
- August 2006
(3 posts)
- July 2006
(1 posts)
- June 2006
(1 posts)
- May 2006
(1 posts)
Categories
- AJAX
(11 posts)
- ASP.net
(1 posts)
- Cloud Computing
(8 posts)
- CSS
(7 posts)
- E-Business
(49 posts)
- E-Commerce
(20 posts)
- E-Government
(3 posts)
- E-Learning
(6 posts)
- Flash
(7 posts)
- HTML
(18 posts)
- Java
(5 posts)
- JavaScript
(17 posts)
- JSON
(5 posts)
- Mobile
(12 posts)
- Multimedia
(20 posts)
- NoSQL
(2 posts)
- Perl
(1 posts)
- Philanthropy
(8 posts)
- PHP
(6 posts)
- Python
(2 posts)
- Semantic Web
(15 posts)
- SQL
(5 posts)
- TV
(1 posts)
- Web Services
(30 posts)
- XML
(10 posts)

Here's something not totally tech-related for Canada Day 2012.
I decided to make a ...