var isIE = (document.all) ? true : false;var $ = function (id) {return "string" == typeof id ? document.getElementById(id) : id;};var Class = {create: function() {return function() { this.initialize.apply(this, arguments); }}}var Extend = function(destination, source) {for (var property in source) {destination[property] = source[property];}}var Bind = function(object, fun) {return function() {return fun.apply(object, arguments);}}var Each = function(list, fun){for (var i = 0, len = list.length; ilen; i++) { fun(list[i], i); }};//ie onlyvar RevealTrans = Class.create();RevealTrans.prototype = {initialize: function(container, options) {this._img = document.createElement("img");this._a = document.createElement("a");this._timer = null;//计时器this.Index = 0;//显示索引this._onIndex = -1;//当前索引this.SetOptions(options);this.Auto = !!this.options.Auto;this.Pause = Math.abs(this.options.Pause);this.Duration = Math.abs(this.options.Duration);this.Transition = parseInt(this.options.Transition);this.List = this.options.List;this.onShow = this.options.onShow;//初始化显示区域this._img.style.visibility = "hidden";//第一次变换时不显示红x图this._img.style.width = this._img.style.height = "100%"; this._img.style.border = 0;this._img.onmouseover = Bind(this, this.Stop);this._img.onmouseout = Bind(this, this.Start);isIE && (this._img.style.filter = "revealTrans()");this._a.target = "_blank";$(container).appendChild(this._a).appendChild(this._img);},//设置默认属性SetOptions: function(options) {this.options = {//默认值Auto:true,//是否自动切换Pause:5000,//停顿时间(微妙)Duration: 1,//变换持续时间(秒)Transition: 23,//变换效果(23为随机)List:[],//数据集合,如果这里不设置可以用Add方法添加onShow:function(){}//变换时执行};Extend(this.options, options || {});},Start: function() {clearTimeout(this._timer);//如果没有数据就返回if(!this.List.length) return;//修正Indexif(this.Index0 || this.Index = this.List.length){ this.Index = 0; }//如果当前索引不是显示索引就设置显示if(this._onIndex != this.Index){ this._onIndex = this.Index; this.Show(this.List[this.Index]); }//如果要自动切换if(this.Auto){this._timer = setTimeout(Bind(this, function(){ this.Index++; this.Start(); }), this.Duration * 1000 +this.Pause);}},//显示Show: function(list) {if(isIE){//设置变换参数with(this._img.filters.revealTrans){Transition = this.Transition; Duration = this.Duration; apply(); play();}}this._img.style.visibility = "";//设置图片属性this._img.src = list.img; this._img.alt = list.text;//设置链接!!list["url"] ? (this._a.href = list["url"]) : this._a.removeAttribute("href");//附加函数this.onShow();},//添加变换对象Add: function(sIimg, sText, sUrl) {this.List.push({ img: sIimg, text: sText, url: sUrl });},//停止Stop: function() {clearTimeout(this._timer);}};.container{width:980px;height:80px;border:0;position:relative;overflow:hidden;}var r = new RevealTrans("idShow");//添加变换对象r.Add(/mediafile/201005/17/F201005170803181194618522.jpg,,http://en.ynta.gov.cn/default.aspx);r.Start();Set as Homepage|Register|Sign InChinese|Big 5|French|Russian|Spanish|Japanese|Arabic|KoreanSpecial Coverage|PD Online DatabaseSina MicroblogTencent MicroblogFeedbackRSS   NewsOpinionsChina MilitaryForeign AffairsLearn ChineseChina StudyForumLatest News:  Li Na breezes through 1st round at Australian Open
Still life with Zhang Yimou: Authorized biography hits the stands
Microsoft to sue Buynow, Gome over counterfeiting
Iranian president seeks to expand ties with L. America, U.S. gets jitters
Chinas foreign trade surges 22.5% in 2011
China playing active role in developing friendly co-op in Asia-Pacific region: economist
Indonesia to apply Chinese loans to infrastructure
2600 evacuated after earthquake
Japan to release Australian anti-whaling activists
120b yuan boost for service industriesBeijing   Sunny    3 / -7   City ForecastPeoples Daily OnlineVideoPC game users increasing in China(CNTV)10:45, January 10, 2012The latest report on China’s game industry notes a steady rise in PC game users over the past years. China had 120-million PC game users in 2011, an increase of 9 percent from the previous year. That includes over 60 million paying subscribers, an annual increase of 46 percent. The report was issued on Monday at the China Game Industry annual conference in the northwest city of Xi’an. The report also predicts that the number of PC game users will rise to 140-million in 2016, catching up with the annual growth rate of internet users.Email|Print|Comments(Editor:王莉莉)Increases the bookmarktwitterfacebookSina MicroblogdiggGoogleDeliciousbuzzfriendfeedLinkedindiigoredditstumbleuponQzoneQQ MicroblogRelated ReadingPC games less fun if theyre politically correctLeave your comment0 commentsNameWeekly reviewChina says trade ties with Iran "open and transparent"
APF Guizhou Contingent conducts winter training
Nepal seeks to benefit from Chinas development
What changes China-Russia oil pipeline has brought?
China sets up fund to preserve traditional cultureChina vows to have top bio scientists by 2020
China eyes next-generation Internet
Will Japans economy recover in 2012?  Selections for youDragon decorations greet approaching Year of Dragon around China2012 Intl Consumer Electronics Show to open in Las VegasFog envelops C Chinas Henan2012 Beijing Book Expo opensMost PopularCooperative research helps pandas and s…China to experience mild inflation for …Asias largest helicopter to hit the ma…US entering era of uncertaintiesFake ‘foreign’ formulaGive up copying US standards without qu…Asia remains most attractive investment…Chinese told to stay calm after shootin…ROK President starts China visitChina to boost diplomatic efforts in As…OpinionsS.Korea, China can pull up from their nosedive
Helping Iran weather a looming storm
Give up copying US standards without question
How to make 3 billion trips in 40 days
Greater say needed on yuans convertibility
Much ado about new stamps and dragons
China takes frank, open stand on Myanmar issueWhats happening in ChinaGetting to the root of itCancer villagers blame polluting industry
Online retailer Jingdong to tap e-book market
Scalpers dial up trouble for iPhone release
Markets still use banned plastic packages
Hong Kongers protest ‘discrimination’PD Online DataYangge in Shaanxi
Gaoqiao in Northern China
The drum dance in Ansai
Shehuo in Baoji City
The dragon dance12345678910111213141516171819202122232425262728293031JanFebMarAprMayJunJulAugSepOctNovDec2007年2008年2009年2010年2011年{resetselect()}About Us| Contact Us| Site Map| Advertise on siteCopyright by Peoples Daily Online, All Rights ReservedBingCW.Init({AppID:"http://english.peopledaily.com.cn/",ContentArea:"p_content,p_title",MachineTranslation:true,WebDefinition:true})

Leave a Reply

Your email address will not be published. Required fields are marked *

three × 4 =