var arrlist = new Array(); var preImage=new Array(); function contentObj(imageUrl,title,jianjie){ this.imageUrl=imageUrl; this.title=title; this.jianjie=jianjie; } var obj=new contentObj("http://www.it.com.cn/audio/speaker/img/2011/11/23/17/03.jpg","低调商务风 翼乐E10手机图赏","低调商务风 翼乐E10手机图赏"); arrlist[0]=obj; var obj=new contentObj("http://www.it.com.cn/audio/speaker/img/2011/11/23/17/04.jpg","低调商务风 翼乐E10手机图赏","低调商务风 翼乐E10手机图赏"); arrlist[1]=obj; var obj=new contentObj("http://www.it.com.cn/audio/speaker/img/2011/11/23/17/05.jpg","低调商务风 翼乐E10手机图赏","低调商务风 翼乐E10手机图赏"); arrlist[2]=obj; var obj=new contentObj("http://www.it.com.cn/audio/speaker/img/2011/11/23/17/06.jpg","低调商务风 翼乐E10手机图赏","低调商务风 翼乐E10手机图赏"); arrlist[3]=obj; var obj=new contentObj("http://www.it.com.cn/audio/speaker/img/2011/11/23/17/07.jpg","低调商务风 翼乐E10手机图赏","低调商务风 翼乐E10手机图赏"); arrlist[4]=obj; var obj=new contentObj("http://www.it.com.cn/audio/speaker/img/2011/11/23/17/08.jpg","低调商务风 翼乐E10手机图赏","低调商务风 翼乐E10手机图赏"); arrlist[5]=obj; var obj=new contentObj("http://www.it.com.cn/audio/speaker/img/2011/11/23/17/01.jpg","低调商务风 翼乐E10手机图赏","低调商务风 翼乐E10手机图赏"); arrlist[6]=obj; var obj=new contentObj("http://www.it.com.cn/audio/speaker/img/2011/11/23/17/02.jpg","低调商务风 翼乐E10手机图赏","低调商务风 翼乐E10手机图赏"); arrlist[7]=obj; function objSort(a,b){ var i1=a.imageUrl; var i2=b.imageUrl; var arr=new Array(); arr[0]=i1; arr[1]=i2; arr.sort(); if(arr[0]==i1){ return -1; }else{ return 1; } } arrlist.sort(objSort); var originImage=new Image(); var cImgName=getRequestParameter("picName"); var originArticleURL=getRequestParameter("articleURL"); var locationURL=getLocationURL(); if(originArticleURL==null||originArticleURL==""){ originArticleURL=document.location.href; } var index=0; window.onload=windowOnload(); function windowOnload(){ index=getCurrnetIndex(cImgName); preImage[0]=new Image(); preImage[1]=new Image(); preImage[2]=new Image(); preImage[3]=new Image(); preImage[4]=new Image(); preImage[5]=new Image(); preImage[0].src=arrlist[index].imageUrl; preImage[0].border=0; //preImage[0].height=380; preImage[0].id='imageCenter'; preImage[1].height=100; preImage[1].src=arrlist[doDown()].imageUrl; preImage[1].border=0; preImage[1].id='imageLeft'; preImage[2].height=100; preImage[2].src=arrlist[doUp()].imageUrl; preImage[2].border=0; preImage[2].id='imageRight'; preImage[3].height=100; preImage[3].src=arrlist[doDownDown()].imageUrl;//上上张 preImage[3].border=0; preImage[3].id='imageLeft_b'; preImage[4].height=100; preImage[4].src=arrlist[doUpUp()].imageUrl;//下下张 preImage[4].border=0; preImage[4].id='imageRight_b'; preImage[5].src=arrlist[index].imageUrl; preImage[5].border=1; preImage[5].height=100; preImage[5].id='imageCenter_b'; } function GetFileName(strUrl,tag){ var v=strUrl.split(tag); return v[v.length-1]; } function getarticleid(strUrl,tag){ var v=strUrl.split(tag); return v[0]; } function dofirst(){ index=0; document.getElementById("imageCenter").src=arrlist[index].imageUrl; document.getElementById("count").innerHTML="总共"+arrlist.length+"张图片,当前第"+(index+1)+"张"; resizeImageWidth("imageCenter",1000); document.getElementById("imageLeft").src=arrlist[doDown()].imageUrl; resizeImageWidth("imageLeft",155); document.getElementById("imageRight").src=arrlist[doUp()].imageUrl; document.getElementById("imageLeft_b").src=arrlist[doDownDown()].imageUrl; document.getElementById("imageRight_b").src=arrlist[doUpUp()].imageUrl; document.getElementById("imageCenter_b").src=arrlist[index].imageUrl; resizeImageWidth("imageRight",155); resizeImageWidth("imageLeft_b",155); resizeImageWidth("imageRight_b",155); resizeImageWidth("imageCenter_b",155); } function dolast(){ index=arrlist.length-1; document.getElementById("imageCenter").src=arrlist[index].imageUrl; document.getElementById("count").innerHTML="总共"+arrlist.length+"张图片,当前第"+(index+1)+"张"; resizeImageWidth("imageCenter",1000); document.getElementById("imageLeft").src=arrlist[doDown()].imageUrl; resizeImageWidth("imageLeft",155); document.getElementById("imageRight").src=arrlist[doUp()].imageUrl; document.getElementById("imageLeft_b").src=arrlist[doDownDown()].imageUrl; document.getElementById("imageRight_b").src=arrlist[doUpUp()].imageUrl; document.getElementById("imageCenter_b").src=arrlist[index].imageUrl; resizeImageWidth("imageRight",155); resizeImageWidth("imageLeft_b",155); resizeImageWidth("imageRight_b",155); resizeImageWidth("imageCenter_b",155); } function init(){ //index=getCurrnetIndex(cImgName); var img=obj.src; var articleid=getarticleid(GetFileName(document.location.href,"/"),"."); articleid=articleid.split("_")[0]; document.getElementById("originArticle").href="http://bsr2007.com/riginArticleURL" //document.getElementById("imageCenter").src=arr[index]; document.getElementById("title").innerHTML=arrlist[index].title; document.getElementById("jianjie").innerHTML=arrlist[index].jianjie; document.getElementById("originURL").href="http://bsr2007.com/bigpic.html?imageURL="+arrlist[index].imageUrl+"&articleURL="+originArticleURL+"&countid="+countid+"&articleid="+articleid; document.getElementById("count").innerHTML="总共"+arrlist.length+"张图片,当前第"+(index+1)+"张"; document.getElementById('imageCenterA').appendChild(preImage[0]); document.getElementById('imageLeftA').appendChild(preImage[1]); document.getElementById('imageRightA').appendChild(preImage[2]); document.getElementById('imageLeftB').appendChild(preImage[3]); document.getElementById('imageRightB').appendChild(preImage[4]); document.getElementById('imageCenterB').appendChild(preImage[5]); resizeImageWidth("imageCenter",1000); //document.getElementById("imageLeft").src=arr[doDown()]; resizeImageWidth("imageLeft",155); resizeImageWidth("imageLeft_b",155); //document.getElementById("imageRight").src=arr[doUp()]; resizeImageWidth("imageRight",155); resizeImageWidth("imageRight_b",155); resizeImageWidth("imageCenter_b",155); document.getElementById('imageCenter').onmousemove=fnStyleMouse; document.getElementById('imageCenter').onclick=fnTrackMouse; } function fnStyleMouse(){ var img=document.getElementById("imageCenter"); var ww=img.width/2; if(window.event.clientX>(ww+img.offsetLeft)){ document.getElementById('imageCenter').className="you"; document.getElementById('imageCenter').title="点击进入下一张>>>>"; }else{ document.getElementById('imageCenter').className="zuo"; document.getElementById('imageCenter').title="<<<<点击进入上一张"; } } function fnTrackMouse(){ var img=document.getElementById("imageCenter"); var ww=img.width/2; if(window.event.clientX>(ww+img.offsetLeft)){ doClick('imageRight'); }else{ doClick('imageLeft'); } } function doClick(id){ var obj=document.getElementById(id); var img=obj.src; var img=obj.src; var articleid=getarticleid(GetFileName(document.location.href,"/"),"."); articleid=articleid.split("_")[0]; document.getElementById("imageCenter").src=img; index=getCurrnetIndex(img); document.getElementById("title").innerHTML=arrlist[index].title; document.getElementById("jianjie").innerHTML=arrlist[index].jianjie; document.getElementById("count").innerHTML="总共"+arrlist.length+"张图片,当前第"+(index+1)+"张"; document.getElementById("imageLeft").src=arrlist[doDown()].imageUrl; document.getElementById("imageRight").src=arrlist[doUp()].imageUrl; document.getElementById("imageLeft_b").src=arrlist[doDownDown()].imageUrl; document.getElementById("imageRight_b").src=arrlist[doUpUp()].imageUrl; document.getElementById("imageCenter_b").src=img; document.getElementById("originURL").href="http://bsr2007.com/bigpic.html?imageURL="+arrlist[index].imageUrl+"&articleURL="+originArticleURL+"&countid="+countid+"&articleid="+articleid; resizeImageWidth("imageCenter",1000); resizeImageWidth("imageLeft",155); resizeImageWidth("imageRight",155); resizeImageWidth("imageLeft_b",155); resizeImageWidth("imageRight_b",155); resizeImageWidth("imageCenter_b",155); document.getElementById("iframe").src="http://gd1.it.com.cn/Article.do?_method=counter&articleId="+articleid; document.getElementById("iframe1").src="http://stats.it.com.cn/count.do?c="+countid+"&r="+escape(document.referrer)+"&u="+escape(document.location.href)+"&t="+escape(document.title)+"&dt="+escape(new Date())+"&i=1"; } function resizeImageWidth(id,width){ var obj=document.getElementById(id); var rect=getOriginImageRect(obj); var height=(width*rect.height)/rect.width; obj.width=width; obj.height=height; } function resizeImageRect(id,height){ var obj=document.getElementById(id); var rect=getOriginImageRect(obj); var width=(height*rect.width)/rect.height; obj.width=width; obj.height=height; } function doUp(){ var i=index+1; if(i>=0 && i=arrlist.length){ return 0; }else{ return -1; } } function doDown(){ var i=index-1; if(i>=0 && i=0 && i=arrlist.length){ return 1; }else{ return -1; } } function doDownDown(){//上上张 var i=index-2; if(i>=0 && i
日期:2011-11-23 作者:炫 出处:IT.com.cn(IT世界网)
齐乐娱乐