/* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ jQuery.noConflict(); jQuery(document).ready(function() { // store jQueries we will reuse var theTicker = jQuery('div#rssTicker'); if ( theTicker.length > 0 ) { var theScrollWrapper = theTicker.children('div.scrollWrapper'); var theScrollableArea = theScrollWrapper.children('div.scrollableArea'); // first, get the rss feed var feedURL = 'http://localhost/ski.utah.edu/skiblog/wp-content/plugins/rss_ticker/feed.xml'; //console.debug(feedURL); jQuery.get(feedURL, {}, function(data, textStatus) { //console.debug(textStatus); // parse the XML var jsonObj = jQuery.xmlToJSON(data); //console.debug(jsonObj); for ( idx=0; idx < jsonObj.channel[0].item.length; idx++ ) { // pull out the titles and append them to the div if ( jsonObj.channel[0].item[idx].link[0].Text.length > 0 ) theScrollableArea.append('

'+jsonObj.channel[0].item[idx].title[0].Text+'

'); else theScrollableArea.append('

'+jsonObj.channel[0].item[idx].title[0].Text+'

'); } // show the div theTicker.slideDown('normal', function() { // make it scroll theTicker.smoothDivScroll( { autoScrollSpeed: 1, autoScroll: "always", autoScrollDirection: "endlessloop", pauseAutoScroll: "mouseover" }); }); }); } });