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/201109/06/F201109060914062809330814.jpg,, http://english.people.com.cn/102775/203036/index.html);r.Start();r.Add(/mediafile/201108/29/F201108291053543177820271.jpg,, http://english.people.com.cn/102759/202921/index.html);r.Start();Set as Homepage|Register|Sign InChinese|Big 5|French|Russian|Spanish|Japanese|ArabicSpecial Coverage|PD Online DatabaseSina MicroblogTencent MicroblogFeedbackRSS   NewsOpinionsChina MilitaryForeign AffairsLearn ChineseChina StudyForumLatest News:  Billionaires shy away from rich list
Mongolia to send 850 peacekeepers to South Sudan
Typhoon kills 6 in Japan, nuke plant not affected
300,000 children aged under 5 die each year
Intl M&A rulings set to exceed 200 this year
IMF cuts China 2011-12 growth estimates
China says trade ties with Latin America boosts economic growth
China summons acting U.S. military attache over arms sales to Taiwan
China says U.S. arms sale to Taiwan creates "severe obstacles" for military-to-military exchanges
Libya mission could end at any time: NATO chiefBeijing   Sunny    27 / 11   City ForecastHomePhotoChinaDry lake woes for migrant bird(China Daily)13:47, September 22, 2011Fishing nets are left on the dry lake bed of Poyang Lake, in Nanchang, East Chinas Jiangxi province, Sept 21, 2011. Poyang Lake - Chinas largest freshwater lake - is experiencing severe drought conditions. The lack of water is killing fish and inhibiting the growth of several kinds of grass that act as food for the migrant birds that will arrive at the lake in one month. [Photo/CFP]【1】 【2】 【3】 【4】Email|Print|Comments(Editor:燕勐)Increases the bookmarktwitterfacebookSina MicroblogdiggGoogleDeliciousbuzzfriendfeedLinkedindiigoredditstumbleuponQzoneQQ MicroblogRelated ReadingWater level of Poyang Lake rises due to recent rainfallBeautiful scene on shores of Lake Namtso, Chinas TibetDrought prompts migratory birds to leave earlyHope dries up with evaporating lakeCentral Chinas "kingdom of lakes" left out to dryRumbling volcano blamed for fishkill in Taal LakeChina begins construction of Hongze Lake segment of South-to-North Water Diversion ProjectGeneral view of newly revived Qingtu lake in Minqin, Chinas GansuBrave man dives into lakeChinas largest saltwater lake grows after 50 years of shrinking Pangong Lake: Paradise for migrant birdsLeave your comment0 commentsNameWeekly reviewChinas actions in Libya show diplomatic maturity
Massive manhunt on after prison break near Beijing
Opinion: China neednt thank Osama bin Laden
What invisible expenditures does US military have?Japan premier talks tough on Chinas military
Chinas J-10 on websites list of "Top Ten Fighter Plane"
India makes waves with South China Sea oil and gas exploration
Beijing Capital Airport quells UFO flight delay rumor  Selections for youF1 driver Jenson Button attends conference for Singapore Night RaceChina (Ningxia) Intl Investment and Trade Fair opensLargest Apple store in Chinese mainland to open7 killed, 24 injured in Tibet as India quake affects ChinaMost PopularObamas economic warfare against Republ…Beijing: Chinas aid to Europe is uncon…China sets launch date for historic spa…Preparation underway for launch of Tian…Strong yuan attracts increase in hot mo…China to fly first Airbus A380 next mon…Largest Apple store in Chinese mainland…Locke lambasts closed sectorsSichuan paramilitary soldiers conduct l…China condemns US arms sales to TaiwanWhats happening in ChinaSAMC signs deal with BoeingPolice nab murder suspects in central China
Maternal, infant death rates drop sharply in China
Chinas flood death toll reaches 90
India earthquake kills 7, injures 136 in Tibet
Citywide checks after polio outbreak in XinjiangPD Online DataChallenge to the traditional view of love and marriage
House means happiness? Young Chinese home-owning dreamFighting AIDS,China is acting
Worldwide Confusius Institutes
Chinese Qingming Festival12345678910111213141516171819202122232425262728293031JanFebMarAprMayJunJulAugSepOctNovDec2007年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 *

4 × 5 =