News Ticker Type #2

by jch02140

HTML

<script src="http://www.gcmingati.net/wordpress/wp-content/lab/jquery/newsticker/jq-liscroll/jquery.li-scroller.1.0.js"></script>
<!-- first ticker -->
<ul id="ticker01">
    <li><span>10/10/2007</span><a href="#/ogt/content/news/News183.complete">The first thing that most Javascript programmers</a>
    </li>
    <li><span>10/10/2007</span><a href="#/ogt/content/news/News175.complete">End up doing is adding some code</a>
    </li>
    <li><span>10/10/2007</span><a href="#/ogt/content/news/News177.complete">The code that you want to run</a>
    </li>
    <li><span>08/10/2007</span><a href="#/ogt/content/news/News176.complete">Inside of which is the code that you want to run</a>
    </li>
    <li><span>08/10/2007</span><a href="#/ogt/content/news/News178.complete">Right when the page is loaded</a>
    </li>
    <li><span>05/10/2007</span><a href="#/ogt/content/news/News173.complete">Problematically, however, the Javascript code</a>
    </li>
    <li><span>04/10/2007</span><a href="#/ogt/content/news/News183.complete">The first thing that most Javascript programmers</a>
    </li>
    <li><span>04/10/2007</span><a href="#/ogt/content/news/News175.complete">End up doing is adding some code</a>
    </li>
    <li><span>04/10/2007</span><a href="#/ogt/content/news/News177.complete">The code that you want to run</a>
    </li>
    <li><span>03/10/2007</span><a href="#/ogt/content/news/News176.complete">Inside of which is the code that you want to run</a>
    </li>
    <li><span>03/10/2007</span><a href="#/ogt/content/news/News178.complete">Right when the page is loaded</a>
    </li>
    <li><span>01/10/2007</span><a href="#/ogt/content/news/News173.complete">Problematically, however, the Javascript code</a>
    </li>
</ul>
<!-- second ticker -->
<ul id="ticker02">
    <li><span>10/10/2007</span><a href="#/ogt/content/news/News183.complete">The first thing that most Javascript programmers</a>
    </li>
    <li><span>10/10/2007</span><a...

CSS

/* liScroll styles */
 .tickercontainer {
    /* the outer div with the black border */
    border: 1px solid #000;
    background: #fff;
    width: 100%;
    height: 27px;
    margin: 0;
    padding: 0;
    overflow: hidden;
}
.tickercontainer .mask {
    /* that serves as a mask. so you get a sort of padding both left and right */
    position: relative;
    left: 10px;
    top: 8px;
    width: 718px;
    overflow: hidden;
}
ul.newsticker {
    /* that's your list */
    position: relative;
    left: 750px;
    font: bold 10px Verdana;
    list-style-type: none;
    margin: 0;
    padding: 0;
}
ul.newsticker li {
    float: left;
    /* important: display inline gives incorrect results when you check for elem's width */
    margin: 0;
    padding: 0;
    background: #fff;
}
ul.newsticker a {
    white-space: nowrap;
    padding: 0;
    color: #ff0000;
    font: bold 10px Verdana;
    margin: 0 50px 0 0;
}
ul.newsticker span {
    margin: 0 10px 0 0;
}

JavaScript

$(function () {
    $("ul#ticker01").liScroll();
    $("ul#ticker02").liScroll({
        travelocity: 0.15
    });
    //Syntax
    $.syntax({
        root: 'http://www.gcmingati.net/wordpress/wp-content/themes/giancarlo-mingati/js/jquery-syntax/'
    });

});