GeekArticles
Database
SQL Server
Database
SQL ServerPausing and Resuming the jQuery / ASP.NET News Ticker
<p>
Many websites display a <i>news ticker</i> of one sort or another. A news ticker is a user interface element that displays a subset of a list of items, cycling through
them one at a time after a set interval. In December 2010 I wrote an article titled <a jQuery and ASP.NET
to Build a News Ticker</a> that explored how to create your own news ticker widget using jQuery and ASP.NET.
The news content is defined as an unordered list (<code><ul></code>) where each list item (<code><li></code>) represents a news headline.
Once the content is defined, having it cycle through the head lines is as simple as calling the JavaScript function
<code>startTicker(<i>id</i>, <i>numberToShow</i>, <i>duration</i>)</code>, which begins cycling the headlines in the unordered list with the specified <i>id</i>,
showing <i>numberToShow</i> headlines at a time and cycling to the next headline every <i>duration</i> number of milliseconds.
</p><p>
This installment shows how to enhance the news ticker to enable pausing and resuming. With these enhancements, the ticker can be configured to automatically
pause rotating its headlines when the user mouses over it, and to resume rotating them once the user mouses out. Similarly, with a bit of additional markup and script
you can add pause and play buttons to a ticker, allowing a user to start and stop the ticker by clicking an image or button.
Read on to learn more!
<br /><a More ></a></p>
Sponsored Links
Related Topics
Subscribe via RSS
SQL Server
- Naming Database Objects: Part II
- Trace Messages Part V: Trace Cleanup
- Naming Database Objects: Part I
- Multiple-Child Aggregation
- Creating SQL Tables for an Integrating Application Using Dexterity
- SQL Server 2005 Beta 2 Transact-SQL Enhancements
- .NET Rocks! - Brian Larson on SQL Server Reporting Services
- Computing the Trimmed Mean in SQL
- SQL Server 2000 Gains on Oracle
- Separator First Formatting (SFF)
