联系我们
  • 武汉佳贝乐商贸有限公司
    全国统一热线:4007366606
    电话:027-82669930
    传真:027-87618678
    地址:地址:湖北省武汉市黄陂区横店街幸福工业园2栋1号(红旗小学对面)
    官方网址:www.jblwh.com
在线留言

当前位置:首页 > 产品展示

豪华转马

更新时间:2012-8-18 13:53:14 点击次数:2597
var D=new Function('obj','return document.getElementById(obj);') function htmlbody(){ return ( document.documentElement.clientHeight<=document.body.clientHeight &&document.documentElement.clientHeight!=0 ) ?document.documentElement:document.body; } //浏览器滚动条位置 function scrollLeft(){return (!window.pageYOffset)?htmlbody().scrollLeft:window.pageXOffset;} function scrollTop(){return (!window.innerHeight)?htmlbody().scrollTop:window.pageYOffset;}//实际应距左距离 function getleft(strobjs,strLeftType,strleft){ var temp_getleft = 0; if (strLeftType=="left"){ temp_getleft = scrollLeft()*1 + strleft*1; }else if (strLeftType=="mid"){ (strleft*1<0) ?temp_getleft = scrollLeft()*1 + strleft*1 + htmlbody().clientWidth*1/2 - strobjs.offsetWidth*1 :temp_getleft = (scrollLeft()*1+strleft*1 + htmlbody().clientWidth*1/2); }else if (strLeftType=="right"){ temp_getleft = scrollLeft()*1 + htmlbody().clientWidth*1 - strleft*1 - strobjs.offsetWidth*1; } return temp_getleft; }function moveTips(strobj,theTop,theLeft,theLeftType) { var old,nowobj = D(strobj); var nowleft = nowobj.style.left.replace("px","")*1;//返回在改变窗口大小或移动横滚动条前的距左部距离(数值) var temp_left = getleft(nowobj,theLeftType,theLeft);//实际应距左距离 var re_theTop = theTop; if (temp_left!=nowleft){//横向递增 (Math.abs(temp_left-nowleft)>3&&Math.abs(temp_left-nowleft)<600) ?((temp_left>nowleft)?nowleft += Math.abs(temp_left-nowleft)/5 :nowleft -= Math.abs(temp_left-nowleft)/5) :nowleft = temp_left; nowobj.style.left = nowleft + "px"; } if (!openweb){old = re_theTop;var openweb;}/*这是默认高度*/; var pos,tt=50; pos = scrollTop()*1-nowobj.offsetTop*1+re_theTop*1; pos = nowobj.offsetTop+pos/10;//纵向开始递增 if (pos < re_theTop) pos = re_theTop; if (pos != old) {nowobj.style.top = pos+"px";tt=5;} old = pos; setTimeout("moveTips('"+strobj+"','"+theTop+"','"+theLeft+"','"+theLeftType+"')",tt); }
moveTips('test3','100','10','right',"1");