var imgArray = [ {title:"只需54.5元,4小时到重庆",img:"http://www.gzec.com.cn/upload/jpg/20180222215708157730756.jpg",link:"http://www.gzec.com.cn/dp-0000000000142802.xhtml"}, {title:"贵阳市出租车3月5号起调价,起步价白天10元夜间12元",img:"http://www.gzec.com.cn/upload/jpg/ac6ab9add4984d708a2a2e521f5d1e09.jpg",link:"http://www.gzec.com.cn/dp-0000000000142801.xhtml"}, {title:"厅党组理论学习中心组召开第一季度学习研讨会",img:"http://www.gzec.com.cn/upload/jpg/W020180208462047614576.jpg",link:"http://www.gzec.com.cn/dp-0000000000142800.xhtml"}, {title:"2018年贵阳市义务植树活动在观山湖公园举行",img:"http://www.gzec.com.cn/upload/jpg/3417eb9bbd161bf9fef25d.jpg",link:"http://www.gzec.com.cn/dp-0000000000142799.xhtml"}, {title:"黔灵镇举行2018年春节慰问暨送温暖活动",img:"http://www.gzec.com.cn/upload/jpg/50e54949b1f91bede5ad02.jpg",link:"http://www.gzec.com.cn/dp-0000000000142798.xhtml"} ]; var photoMarquee = function (){ if($('run-photo-plane').scrollLeft>=($('run-photo').getStyle('width').toInt() - $('run-photo-plane').getStyle('width').toInt()) -5) { $('run-photo-plane').scrollLeft=1; } else{ $('run-photo-plane').scrollLeft++; } } window.addEvent('domready', function() { if (imgArray.length>0) new JChangeIMG({container:$("put-photo-here"),data:imgArray,sleep:3500}); var photoPanle = $('run-photo'); if (photoPanle) photoPanle.setStyle('width',$('run-photo-plane').getStyle('width').toInt() *2); photoMarquee.periodical(50);//滚动 var titleList = $$('.menuPanel li.pTitle');//选择触发层 var pnodeChilds = $$('#pNodePanel div.pnode');//定义显示层 pnodeChilds.setStyle('display', 'none'); titleList.each(function(e,index)//设置触发层和显示层对应数组 { var pe = pnodeChilds[index]; e.addEvent('mouseenter', function(){//鼠标触发事件 pnodeChilds.setStyle('display', 'none'); pe.setStyle('display', 'block');//设置操作层为显示 }); }) titleList[2].fireEvent('mouseenter'); });