Tech Tutorials Database
GeekArticles Database SQL Server
 

Pausing and Resuming the jQuery / ASP.NET News Ticker

 
Author: 4guysfromrolla.com
Category: SQL Server
Comments (0)

<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>&lt;ul&gt;</code>) where each list item (<code>&lt;li&gt;</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 &gt;</a></p>

Read More...




Sponsored Links




Read Next: Sorting and Paging a Grid of Data in ASP.NET MVC



 

 

Comments



Post Your Comment:

Your Name:*
e-mail ID:(required for notification)*
Image Verification: 
 
 Subscribe