[Phphtmllib-devel] SF.net SVN: phphtmllib:[3371] trunk/open2300/htdocs/js
Status: Beta
Brought to you by:
hemna
From: <he...@us...> - 2010-02-26 07:12:18
|
Revision: 3371 http://phphtmllib.svn.sourceforge.net/phphtmllib/?rev=3371&view=rev Author: hemna Date: 2010-02-26 07:12:12 +0000 (Fri, 26 Feb 2010) Log Message: ----------- added ticker Modified Paths: -------------- trunk/open2300/htdocs/js/main.js Added Paths: ----------- trunk/open2300/htdocs/js/ticker.js Modified: trunk/open2300/htdocs/js/main.js =================================================================== --- trunk/open2300/htdocs/js/main.js 2010-02-26 07:11:41 UTC (rev 3370) +++ trunk/open2300/htdocs/js/main.js 2010-02-26 07:12:12 UTC (rev 3371) @@ -4,7 +4,6 @@ function start_updates() { - //init_calendar_popup(); set_orig_time(new Date()); var counter = new PeriodicalExecuter(function() { Added: trunk/open2300/htdocs/js/ticker.js =================================================================== --- trunk/open2300/htdocs/js/ticker.js (rev 0) +++ trunk/open2300/htdocs/js/ticker.js 2010-02-26 07:12:12 UTC (rev 3371) @@ -0,0 +1,54 @@ +/** + * This file manages updating and showing the ticker + * above the banner image. + */ + +var ticker_data; +var ci=0; +var ri=0; + +function start_ticker() { + + set_orig_time(new Date()); + var data = new PeriodicalExecuter(function() { + new Ajax.Request("http://192.168.1.118/?target=ticker", + { method:'get', + asynchronous:true, + onSuccess: function(req,json) { + ticker_data = eval('(' + req.responseText + ')'); + } + }); + },5); + + + var ticker = new PeriodicalExecuter(function() { + if (ticker_data != undefined) { + //console.log("update ticker "+ci); + //console.log(ticker_data.middle); + clength = ticker_data.middle.length; + rlength = ticker_data.right.length; + + if (ci >= clength) { + ci = 0; + } + + Effect.Fade('headtopcenter', {duration: 0.5, afterFinish: function() { + $("headtopcenter").innerHTML = ticker_data.middle[ci]; + Effect.Appear('headtopcenter', {duration: 0.5}); + }}); + + if (ri >= rlength) { + ri = 0; + } + + Effect.Fade('headtopright', {duration: 0.5, afterFinish: function() { + $("headtopright").innerHTML = ticker_data.right[ri]; + Effect.Appear('headtopright', {duration: 0.5}); + }}); + + ci++; + ri++; + } + },3); + +} \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |