/* 地图搜索内容栏 隐藏显示效果 */ $(function(){ if(!document.getelementbyid("addrbox")){return} var $addrbox = $("#addrbox"); var $mapmsgbox = $("#mapmsgbox"); var $mapcontrolbtn = $("#mapcontrolbtn"); $mapcontrolbtn.click(function(){ var datastate = $(this).attr("data-state"); if(parseint(datastate,10)){ $("#addrbox").animate({ "right":-205 },"show") $(this).attr("data-state",0).removeclass("on") $(this).animate({ "left":641 },"show") }else{ $("#addrbox").animate({ "right":13 },300) $(this).animate({ "left":423 },300) $(this).attr("data-state",1).addclass("on") } }) }) /* 上下滚动效果 */ function scollbox() { var oul=document.getelementbyid('msgcontent'); var ali=oul.getelementsbytagname('li'); var owrap=document.getelementbyid('mapmsgbox'); var boxheight = owrap.offsetheight; var oup=document.getelementbyid('maptopbtn'); var odown=document.getelementbyid("mapbottbtn"); function css(obj, attr, value) { if(arguments.length==2) { if(attr!='opacity') { return parseint(obj.currentstyle?obj.currentstyle[attr]:document.defaultview.getcomputedstyle(obj, false)[attr]); } else { return math.round(100*parsefloat(obj.currentstyle?obj.currentstyle[attr]:document.defaultview.getcomputedstyle(obj, false)[attr])); } } else if(arguments.length==3) switch(attr) { case 'width': case 'height': case 'paddingleft': case 'paddingtop': case 'paddingright': case 'paddingbottom': value=math.max(value,0); case 'left': case 'top': case 'marginleft': case 'margintop': case 'marginright': case 'marginbottom': obj.style[attr]=value+'px'; break; case 'opacity': obj.style.filter="alpha(opacity:"+value+")"; obj.style.opacity=value/100; break; default: obj.style[attr]=value; } return function (attr_in, value_in){css(obj, attr_in, value_in)}; } var frame_move_type={ buffer: 1, flex: 2 }; function stopmove(obj) { clearinterval(obj.timer); } function startmove(obj, otarget, itype, fncallback, fnduring) { var fnmove=null; if(obj.timer) { clearinterval(obj.timer); } switch(itype) { case frame_move_type.buffer: fnmove=domovebuffer; break; case frame_move_type.flex: fnmove=domoveflex; break; } obj.timer=setinterval(function (){ fnmove(obj, otarget, fncallback, fnduring); }, 30); } function domovebuffer(obj, otarget, fncallback, fnduring) { var bstop=true; var attr=''; var speed=0; var cur=0; for(attr in otarget) { cur=css(obj, attr); if(otarget[attr]!=cur) { bstop=false; speed=(otarget[attr]-cur)/15; speed=speed>0?math.ceil(speed):math.floor(speed); css(obj, attr, cur+speed); } } if(fnduring)fnduring.call(obj); if(bstop) { clearinterval(obj.timer); obj.timer=null; if(fncallback)fncallback.call(obj); } } function domoveflex(obj, otarget, fncallback, fnduring) { var bstop=true; var attr=''; var speed=0; var cur=0; for(attr in otarget) { if(!obj.ospeed)obj.ospeed={}; if(!obj.ospeed[attr])obj.ospeed[attr]=0; cur=css(obj, attr); if(math.abs(otarget[attr]-cur)>=1 || math.abs(obj.ospeed[attr])>=1) { bstop=false; obj.ospeed[attr]+=(otarget[attr]-cur)/5; obj.ospeed[attr]*=0.7; css(obj, attr, cur+obj.ospeed[attr]); } } if(fnduring)fnduring.call(obj); if(bstop) { clearinterval(obj.timer); obj.timer=null; if(fncallback)fncallback.call(obj); } } odown.onmousedown=function() { if(oul.offsetheight