ASP Code
  Home arrow ASP Code arrow Display a dynamic Ticker tape by Max Cappe...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Dedicated Servers 
Actuate Whitepapers 
Moblin 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ASP CODE

Display a dynamic Ticker tape by Max Cappellari
By: aspfree
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 3
    2002-02-18

    Table of Contents:

    Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    Display a dynamic Ticker tape. The content can be read from a database.
    The speed, background color, font, width and height can be customized.
    This project is divided into 2 parts:

    1) Include File: Ticker Tape Code (TickerInclude.asp)
    2) Main file: the file you want to put the Ticker tape into.


    Here is the code:

    TickerInclude.asp

    <%
        'Created by Max Cappellari
        'to get the content from a Database:
        'simply create a Recordset object here.
       
       
        Link1 = "<a href='http://www.yahoo.com'>http://www.yahoo.com</a>"
        Link2 = "<a href='http://www.cnn.com'>http://www.cnn.com</a>"
        Link3 = "<a href='http://www.aol.com'>http://www.aol.com</a>"
       
        'Settings
        TickerColor = "#9CD3FF"
        TickerHeight = 15
        TickerWidth = 300
       
    %>

    <style>
    <!--
    #tickertape {
    position:relative;
    layer-background-color:<%=TickerColor%>;
    width:<%=Tickerwidth%>;
    height:<%=TickerHeight%>;
    }

    #subtickertape{
    background-color:<%=TickerColor%>;
    position:absolute;
    border: 0px <%=TickerColor%>
    width:<%=Tickerwidth%>;
    height:<%=TickerHeight%>;
    }

    .subtickertapefont {
    font: 12px underlined Verdana;
    text-decoration:none;
    color:black;
    }

    .subtickertapefont a {
    color:black;
    text-decoration:none;
    }
    -->
    </style>

    <script language="JavaScript">

    function regenerate() {
        window.location.reload()

    }

    function regenerate2() {
        if (document.layers)
            setTimeout("window.onresize = regenerate",450)
    }

    function update() {
       
        if (document.layers){
            document.tickertape.document.subtickertape.document.write ('<span class="subtickertapefont">'+news[i]+'</span>')
            document.tickertape.document.subtickertape.document.close()
        }
        else
        {
            document.all.subtickertape.innerHTML=news[i]
        }
       
        if (i<news.length-1)
        i++
        else
        i=0
        setTimeout("update()",speed)
        }
       

    </script>
    <%' To get the content from a database, Loop through the recordset here %>

    <form name="tform" id="tform">
    <input type=hidden name="link1" value="<%=Link1%>">
    <input type=hidden name="link2" value="<%=Link2%>">
    <input type=hidden name="link3" value="<%=Link3%>">
    </form>

    <% 'end of loop %>

    <script language="Javascript">
    //default speed is 4.5 seconds
    var speed = 4500

    var news = new Array()

    news[0] = document.forms["tform"].item("link1").value
    news[1] = document.forms["tform"].item("link2").value
    news[2] = document.forms["tform"].item("link3").value

    i = 0

    </script>

    <table border=0 bgcolor="<%=TickerColor%>" cellpadding=0 cellspacing=0 width=<%=TickerWidth%>>
    <tr bgcolor="<%=TickerColor%>" height=<%=TickerHeight%>>
    <td bgcolor="<%=TickerColor%>">
    <div id="tickertape">
        <div id="subtickertape" class="subtickertapefont">Initializing...</div>
    </div>
    </td>
    </tr>
    </table>

    <!-- end of file-->


    Then in the Main file just add the following in the <BODY> Tag:


    <BODY Onload = "if (document.all||document.layers){regenerate2();update()}">

    <!--#include File="TickerInclude.asp"-->


    That's it!



    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

    More ASP Code Articles
    More By aspfree

     

    IBM® developerWorks developerWorks - FREE Tools!


    NEW! Calling all CC Power Users – and those that would like to be!

    Join this Rational Talks to You teleconference, featuring Paul Boustany and Mark Krasovich, to speak to the experts about becoming a Rational ClearCase power user. Get a chance to ask your questions and learn tips and tricks for using Rational ClearCase in Agile development
    FREE! Go There Now!


    NEW! A Layered approach to delivering security-rich Web applications

    As businesses grow increasingly dependent upon Web applications to provide services to customers, employees and partners, these complex applications become more difficult to secure. Although traditional security solutions protect Internet infrastructure layers, they do not guard against HTTP and HTML attacks. Many organizations that conduct security testing still deploy applications that allow attackers to manipulate their logic and wreak havoc on their business. To mitigate this risk, development and delivery teams must address Web application security throughout the lifecycle, addressing the many layers detailed in this paper.
    FREE! Go There Now!


    NEW! Best Practices in Integrated Requirements Management

    Poor Requirements Management capabilities in an Enterprise have been linked to excessive project failures, escalating IT costs, and failure to deliver competitive advantage into the marketplace. Join Brianna M Smith from IBM Rational and learn about how successful organizations align IT and Business stakeholders through collaborative processes and tools for effective requirements management, and how an integrated approach across the IT lifecycle can provide unparalleled visibility and traceability to ensure that project teams are delivering on the business vision by "doing the right things" and "doing things right."
    FREE! Go There Now!


    NEW! BlammoSplat: Build a community Web site of OpenLaszlo animations, Part 3: The community animation

    Learn to enable users to both rate existing animations and to combine existing animations into new snippets. This is the third in a series of three tutorials that chronicle the building of a site that enables collaborative discussion and animation building using Domino and OpenLaszlo.
    FREE! Go There Now!


    NEW! Download DB2 9.5 for Linux, Unix, and Windows

    Download a free trial version of IBM DB2 9.5 for Linux, UNIX, and Windows. DB2 9 is the result of a five-year development project that transformed traditional (static) database technology into an interactive data server that merges the high performance and ease of use of DB2 with the self-describing benefits of XML.
    FREE! Go There Now!


    NEW! Download IBM Rational Developer for System z

    Download a free trial version of IBM Rational Developer for System z, software that can help you deliver core development capabilities; the power of Java Platform, Enterprise Edition (Java EE); and rapid application development support to diverse enterprise application development teams. With comprehensive development tools to help create, deploy and maintain traditional enterprise and composite applications, Rational Developer for System z enables developers with different technical backgrounds to easily participate in important technology projects.
    FREE! Go There Now!


    NEW! Evaluate Rational Business Developer V7.1

    Visit IBM developerWorks to download a free trial version of IBM Rational Business Developer V7.1. Rational Business Developer offers rapid and simplified development of business applications and services through Enterprise Generation Language (EGL) tools, generating Java or mainframe solutions while shielding developers from technical complexities.
    FREE! Go There Now!


    NEW! Hello World: Monitor a simple business process using WebSphere Business Monitor V6.0.2

    This tutorial shows new users of IBM WebSphere Business Monitor Version 6.0.2 how to perform the "Hello World" equivalent for monitoring business process applications. It is intended to help you get familiar with the capabilities of the product.
    FREE! Go There Now!


    NEW! IBM Enterprise Modernization Sandbox for System z

    IBM Enterprise Modernization solutions help organizations evolve core IT systems towards modern architectures and technologies—reducing the burden of maintenance and freeing up resources to develop new business requirements and capabilities. With the IBM Enterprise Modernization Sandbox for System z you can evaluate IBM Enterprise Modernization solutions focused on five key areas: Assets, Architectures, Skills, Processes and Infrastructures, and Investment. Each solution is based upon real customer experiences and offers a proven path to get you started with your modernization projects.
    FREE! Go There Now!


    NEW! IBM Rational AppScan Standard Edition V7.7

    Secure your Web applications with IBM Rational AppScan Standard Edition V7.7, previously known as Watchfire AppScan. This Web application security testing tool automates vulnerability assessments and scans and tests for common Web application vulnerabilities. Visit IBM developerWorks to download a free trial of IBM Rational AppScan Standard Edition V7.7.
    FREE! Go There Now!



    All FREE IBM® developerWorks Tools!

    ASP CODE ARTICLES

    - ASP Forms
    - ASP: The Beginning
    - Getting Remote Files With ASP Continued
    - Inbox and Outbox Manipulation in ASP
    - Relational DropDownList Using VB.NET
    - Ad Tracking URL Hits
    - Use ViewState to display one record per page...
    - Send Email using ASP.NET formatted in HTML
    - ASP File Explorer
    - ASP/XML Interview questions by Srivatsan Sri...
    - Various methods of setting Date values to a ...
    - Conditional DataGrid Item and using checkbox...
    - Fill .NET Listbox with SQL DataReader
    - Filling Dropdown box using Code-Behinds in C#
    - FLAMES code sample written in .NET What is F...





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway