var Pop=function(options){this.isIE=(document.all)?true:false;this.isIE6=this.isIE&&(navigator.userAgent.indexOf('MSIE 6.0')!=-1);this.isIE6?this.position="absolute":this.position="fixed";this.SetOptions(options);this.mode=this.options.mode;this.zIndex=this.options.zIndex;this.left=this.options.left;this.right=this.options.right;this.top=this.options.top;this.bottom=this.options.bottom;this.oPop=$("#"+this.options.oPop);this.oPop.css({position:this.position,"z-index":this.zIndex});if(this.options.beCover){this.Start();this.Initialization();this.FullScreen(this.heightDocument,this.widthDocument)}if(!!this.options.idShrink)this.Shrink(this.options.idShrink);if(this.options.idClose.length!=0)this.Close(this.options.idClose);!!this.options.idOpen?this.Open(this.options.idOpen):this.Start()};Pop.prototype={SetOptions:function(options){this.options={oPop:"idPop",zIndex:"999",left:0,right:0,top:0,bottom:0,mode:["left","top"],beCover:false,cover:false,zIndexCover:888,colorCover:"#000",opactiyCover:0.5,idShrink:null,minHeight:0,maxHeight:0,classOne:null,classTwo:null,idOpen:null,idClose:[]};$.extend(this.options,options||{})},Initialization:function(){this.widthPop=this.oPop.width();this.heightPop=this.oPop.height();this.heightDocument=$(document).height();this.widthDocument=Math.min($(document).width(),$("body").width());this.heightWindow=$(window).height();this.widthWindow=$(window).width();this.topScroll=$(window).scrollTop();this.leftScroll=$(window).scrollLeft()},Start:function(){switch(this.mode[0].toLowerCase()){case"left":this.LeftRightLocation();break;case"right":this.LeftRightLocation();break;default:this.CenterLocation()}},GetValue:function(){if(this.oPop.css("display")=="none")return;var level=this.mode[0].toLowerCase(),vertical=this.mode[1].toLowerCase();this.Initialization();if(){if(!this.isIE6){level=="left"?this.oPop.css({left:this.left}):this.oPop.css({right:this.right});vertical=="top"?this.oPop.css({top:this.top}):this.oPop.css({bottom:this.bottom})}else{var x_final=level=="left"?this.leftScroll+this.left:this.widthWindow+this.leftScroll-this.widthPop-this.right;var y_final=vertical=="top"?this.topScroll+this.top:this.heightWindow+this.topScroll-this.heightPop-this.bottom;this.oPop.css({top:y_final,left:x_final})}}else{if(!this.isIE6){var x_final=parseInt((this.widthWindow-this.widthPop)/2);var y_final=parseInt((this.heightWindow-this.heightPop)/2)}else{var x_final=(this.widthWindow-this.widthPop)/2+this.leftScroll;var y_final=(this.heightWindow-this.heightPop)/2+this.topScroll}this.oPop.css({top:y_final,left:x_final})}if(this.isIE6){this.AddIframe(this.oPop,this.heightPop,this.widthPop)}},LeftRightLocation:function(){this.GetValue(true);var _this=this;$(window).bind("scroll."+this.options.oPop,function(){_this.GetValue(true)}).bind("resize."+this.options.oPop,function(){_this.GetValue(true)})},CenterLocation:function(){this.GetValue(false);var _this=this;$(window).bind("scroll."+this.options.oPop,function(){_this.GetValue(false)}).bind("resize."+this.options.oPop,function(){_this.GetValue(false);if(_this.oPop.css("display")!="none")_this.FullScreen(_this.heightDocument,_this.widthDocument)})},FullScreen:function(oHeight,oWidth){if(!this.options.cover)return;this.zIndexCover=this.options.zIndexCover;this.colorCover=this.options.colorCover;this.opactiyCover=this.options.opactiyCover;if($("#popMask").length==0)$("body").append("<div id=\"popMask\"></div>");if(this.isIE6){$("#popMask").css({position:"absolute","z-index":this.zIndexCover,top:0,left:0,height:oHeight,width:oWidth,opacity:this.opactiyCover,background:this.colorCover});this.AddIframe($("#popMask"),oHeight,oWidth)}else{$("#popMask").css({position:"fixed","z-index":this.zIndexCover,top:0,left:0,height:"100%",width:"100%",opacity:this.opactiyCover,background:this.colorCover})}},AddIframe:function(iElement,iHeight,iWidth){iElement.append("<iframe></iframe>");var oIframe=iElement.children("iframe");oIframe.css({position:"absolute",top:0,left:0,opacity:0,"z-index":-1,height:iHeight,width:iWidth,border:0})},Shrink:function(iShrink){this.minHeight=this.options.minHeight;this.maxHeight=this.options.maxHeight;this.classOne=this.options.classOne;this.classTwo=this.options.classTwo;var _this=this;$("#"+iShrink).toggle(function(){_this.oPop.height(_this.minHeight);$(this).removeClass();$(this).addClass(_this.classOne);if(_this.isIE6)_this.GetValue(true)},function(){_this.oPop.height(_this.maxHeight);$(this).removeClass();$(this).addClass(_this.classTwo);if(_this.isIE6)_this.GetValue(true)})},Close:function(iClose){var _this=this;$.each(iClose,function(index,name){$("#"+name).click(function(){_this.oPop.css({display:"none"});if(!!$("#popMask")[0]){$("#popMask").remove()}$(window).unbind("scroll."+_this.options.oPop);$(window).unbind("resize."+_this.options.oPop)})})},Open:function(iOpen){var _this=this;var oOpen=$("#"+iOpen);oOpen.click(function(){_this.oPop.css({display:"block"});_this.Start();_this.FullScreen(_this.heightDocument,_this.widthDocument)})}};jQuery.easing['jswing']=jQuery.easing['swing'];jQuery.extend(jQuery.easing,{def:'easeOutQuad',swing:function(x,t,b,c,d){return jQuery.easing[jQuery.easing.def](x,t,b,c,d)},easeInQuad:function(x,t,b,c,d){return c*(t/=d)*t+b},easeOutQuad:function(x,t,b,c,d){return-c*(t/=d)*(t-2)+b},easeInOutQuad:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t+b;return-c/2*((--t)*(t-2)-1)+b},easeInCubic:function(x,t,b,c,d){return c*(t/=d)*t*t+b},easeOutCubic:function(x,t,b,c,d){return c*((t=t/d-1)*t*t+1)+b},easeInOutCubic:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t+b;return c/2*((t-=2)*t*t+2)+b},easeInQuart:function(x,t,b,c,d){return c*(t/=d)*t*t*t+b},easeOutQuart:function(x,t,b,c,d){return-c*((t=t/d-1)*t*t*t-1)+b},easeInOutQuart:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t+b;return-c/2*((t-=2)*t*t*t-2)+b},easeInQuint:function(x,t,b,c,d){return c*(t/=d)*t*t*t*t+b},easeOutQuint:function(x,t,b,c,d){return c*((t=t/d-1)*t*t*t*t+1)+b},easeInOutQuint:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t*t+b;return c/2*((t-=2)*t*t*t*t+2)+b},easeInSine:function(x,t,b,c,d){return-c*Math.cos(t/d*(Math.PI/2))+c+b},easeOutSine:function(x,t,b,c,d){return c*Math.sin(t/d*(Math.PI/2))+b},easeInOutSine:function(x,t,b,c,d){return-c/2*(Math.cos(Math.PI*t/d)-1)+b},easeInExpo:function(x,t,b,c,d){return(t==0)?b:c*Math.pow(2,10*(t/d-1))+b},easeOutExpo:function(x,t,b,c,d){return(t==d)?b+c:c*(-Math.pow(2,-10*t/d)+1)+b},easeInOutExpo:function(x,t,b,c,d){if(t==0)return b;if(t==d)return b+c;if((t/=d/2)<1)return c/2*Math.pow(2,10*(t-1))+b;return c/2*(-Math.pow(2,-10*--t)+2)+b},easeInCirc:function(x,t,b,c,d){return-c*(Math.sqrt(1-(t/=d)*t)-1)+b},easeOutCirc:function(x,t,b,c,d){return c*Math.sqrt(1-(t=t/d-1)*t)+b},easeInOutCirc:function(x,t,b,c,d){if((t/=d/2)<1)return-c/2*(Math.sqrt(1-t*t)-1)+b;return c/2*(Math.sqrt(1-(t-=2)*t)+1)+b},easeInElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4}else var s=p/(2*Math.PI)*Math.asin(c/a);return-(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b},easeOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4}else var s=p/(2*Math.PI)*Math.asin(c/a);return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b},easeInOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d/2)==2)return b+c;if(!p)p=d*(.3*1.5);if(a<Math.abs(c)){a=c;var s=p/4}else var s=p/(2*Math.PI)*Math.asin(c/a);if(t<1)return-.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*.5+c+b},easeInBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*(t/=d)*t*((s+1)*t-s)+b},easeOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b},easeInOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;if((t/=d/2)<1)return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b},easeInBounce:function(x,t,b,c,d){return c-jQuery.easing.easeOutBounce(x,d-t,0,c,d)+b},easeOutBounce:function(x,t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b}else if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+.75)+b}else if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+.9375)+b}else{return c*(7.5625*(t-=(2.625/2.75))*t+.984375)+b}},easeInOutBounce:function(x,t,b,c,d){if(t<d/2)return jQuery.easing.easeInBounce(x,t*2,0,c,d)*.5+b;return jQuery.easing.easeOutBounce(x,t*2-d,0,c,d)*.5+c*.5+b}});(function($){$.extend({door:function(n,c,m,s,i){var n,c,center;n=$(n);c=$(c);var prevFlag,prevImg;var autoFlag=function(num){if(prevFlag)prevFlag.removeClass(s);n.eq(num).addClass(s);prevFlag=n.eq(num);center=num};var autoImg=function(num){if(prevImg)prevImg.hide();c.eq(num).fadeIn("slow");prevImg=c.eq(num)};n.bind(m,function(){if(center!=n.index(this)){autoFlag(n.index(this));autoImg(n.index(this))}});autoFlag(i);autoImg(i)},door_:function(n,c,m,s,i){var n,c,center;n=$(n);c=$(c);var flag=1;var prevFlag,prevImg;var autoFlag=function(num){if(prevFlag)prevFlag.removeClass(s);n.eq(num).addClass(s);prevFlag=n.eq(num);center=num};var autoImg=function(num){if(prevImg)prevImg.hide();c.eq(num).fadeIn("slow");prevImg=c.eq(num)};n.bind(m,function(){if(flag){autoFlag(n.index(this));autoImg(n.index(this));flag=0}});n.mouseout(function(){flag=1});autoFlag(i);autoImg(i)},autoPlay:function(nx,c,m,s,i,t,tl,tag){var n,c,nb,center,val=null,st=null;c=$(c);if(tag){nb=$(nx);var tag=tag.split(".");if(c.size()>1){for(var o=1;o<c.size()+1;o++){$("<"+tag[0]+"/>").text(o).addClass(tag[1]).appendTo(nb)}}n=$(nx+" "+tag)}else{n=$(nx)}c.hide();n.bind(m,function(){var self=this;if(st)clearTimeout(st);st=setTimeout(function(){autoFlag(n.index(self));autoImg(n.index(self))},tl)});n.hover(function(){if(val)clearInterval(val)},function(){autoAdd();if(st)clearTimeout(st)});c.hover(function(){if(val)clearInterval(val)},function(){autoAdd()

解决方案 »

  1.   

    本帖最后由 showbo 于 2013-09-11 21:15:14 编辑
      

  2.   

    http://app.baidu.com/app/enter?appid=121305用这个工具排版,原来的代码缩进删除了而已
      

  3.   

    http://app.baidu.com/app/enter?appid=121305
    用这个弄成这样了,已经失去了js基本功效了,谁帮帮忙呗,谢谢了
    下面代码不能全部拷贝进来,只拷贝了一部分进来
    jQuery.easing['jswing'] = jQuery.easing['swing'];
    jQuery.extend(jQuery.easing, {
            def: 'easeOutQuad',
            swing: function(x, t, b, c, d) {
                    return jQuery.easing[jQuery.easing.def](x, t, b, c, d)
            },
            easeInQuad: function(x, t, b, c, d) {
                    return c * (t /= d) * t + b
            },
            easeOutQuad: function(x, t, b, c, d) {
                    return - c * (t /= d) * (t - 2) + b
            },
            easeInOutQuad: function(x, t, b, c, d) {
                    if ((t /= d / 2) < 1) return c / 2 * t * t + b;
                    return - c / 2 * ((--t) * (t - 2) - 1) + b
            },
            easeInCubic: function(x, t, b, c, d) {
                    return c * (t /= d) * t * t + b
            },
            easeOutCubic: function(x, t, b, c, d) {
                    return c * ((t = t / d - 1) * t * t + 1) + b
            },
            easeInOutCubic: function(x, t, b, c, d) {
                    if ((t /= d / 2) < 1) return c / 2 * t * t * t + b;
                    return c / 2 * ((t -= 2) * t * t + 2) + b
            },
            easeInQuart: function(x, t, b, c, d) {
                    return c * (t /= d) * t * t * t + b
            },
            easeOutQuart: function(x, t, b, c, d) {
                    return - c * ((t = t / d - 1) * t * t * t - 1) + b
            },
            easeInOutQuart: function(x, t, b, c, d) {
                    if ((t /= d / 2) < 1) return c / 2 * t * t * t * t + b;
                    return - c / 2 * ((t -= 2) * t * t * t - 2) + b
            },
            easeInQuint: function(x, t, b, c, d) {
                    return c * (t /= d) * t * t * t * t + b
            },
            easeOutQuint: function(x, t, b, c, d) {
                    return c * ((t = t / d - 1) * t * t * t * t + 1) + b
            },
            easeInOutQuint: function(x, t, b, c, d) {
                    if ((t /= d / 2) < 1) return c / 2 * t * t * t * t * t + b;
                    return c / 2 * ((t -= 2) * t * t * t * t + 2) + b
            },
            easeInSine: function(x, t, b, c, d) {
                    return - c * Math.cos(t / d * (Math.PI / 2)) + c + b
            },
            easeOutSine: function(x, t, b, c, d) {
                    return c * Math.sin(t / d * (Math.PI / 2)) + b
            },
            easeInOutSine: function(x, t, b, c, d) {
                    return - c / 2 * (Math.cos(Math.PI * t / d) - 1) + b
            },
            easeInExpo: function(x, t, b, c, d) {
                    return (t == 0) ? b: c * Math.pow(2, 10 * (t / d - 1)) + b
            },
            easeOutExpo: function(x, t, b, c, d) {
                    return (t == d) ? b + c: c * ( - Math.pow(2, -10 * t / d) + 1) + b
            },
            easeInOutExpo: function(x, t, b, c, d) {
                    if (t == 0) return b;
                    if (t == d) return b + c;
                    if ((t /= d / 2) < 1) return c / 2 * Math.pow(2, 10 * (t - 1)) + b;
                    return c / 2 * ( - Math.pow(2, -10 * --t) + 2) + b
            },
            easeInCirc: function(x, t, b, c, d) {
                    return - c * (Math.sqrt(1 - (t /= d) * t) - 1) + b
            },
            easeOutCirc: function(x, t, b, c, d) {
                    return c * Math.sqrt(1 - (t = t / d - 1) * t) + b
            },
            easeInOutCirc: function(x, t, b, c, d) {
                    if ((t /= d / 2) < 1) return - c / 2 * (Math.sqrt(1 - t * t) - 1) + b;
                    return c / 2 * (Math.sqrt(1 - (t -= 2) * t) + 1) + b
            },
            easeInElastic: function(x, t, b, c, d) {
                    var s = 1.70158;
                    var p = 0;
                    var a = c;
                    if (t == 0) return b;
                    if ((t /= d) == 1) return b + c;
                    if (!p) p = d * .3;
                    if (a < Math.abs(c)) {
                            a = c;
                            var s = p / 4
                    } else var s = p / (2 * Math.PI) * Math.asin(c / a);
                    return - (a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b
            },
            easeOutElastic: function(x, t, b, c, d) {
                    var s = 1.70158;
                    var p = 0;
                    var a = c;
                    if (t == 0) return b;
                    if ((t /= d) == 1) return b + c;
                    if (!p) p = d * .3;
                    if (a < Math.abs(c)) {
                            a = c;
                            var s = p / 4
                    } else var s = p / (2 * Math.PI) * Math.asin(c / a);
                    return a * Math.pow(2, -10 * t) * Math.sin((t * d - s) * (2 * Math.PI) / p) + c + b
            },
            easeInOutElastic: function(x, t, b, c, d) {
                    var s = 1.70158;
                    var p = 0;
                    var a = c;
                    if (t == 0) return b;
                    if ((t /= d / 2) == 2) return b + c;
                    if (!p) p = d * (.3 * 1.5);
                    if (a < Math.abs(c)) {
                            a = c;
                            var s = p / 4
                    } else var s = p / (2 * Math.PI) * Math.asin(c / a);
                    if (t < 1) return - .5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b;
                    return a * Math.pow(2, -10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p) * .5 + c + b
            },
            easeInBack: function(x, t, b, c, d, s) {
                    if (s == undefined) s = 1.70158;
                    return c * (t /= d) * t * ((s + 1) * t - s) + b
            },
            easeOutBack: function(x, t, b, c, d, s) {
                    if (s == undefined) s = 1.70158;
                    return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b
            },
            easeInOutBack: function(x, t, b, c, d, s) {
                    if (s == undefined) s = 1.70158;
                    if ((t /= d / 2) < 1) return c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b;
                    return c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b
            },
            easeInBounce: function(x, t, b, c, d) {
                    return c - jQuery.easing.easeOutBounce(x, d - t, 0, c, d) + b
            },
            easeOutBounce: function(x, t, b, c, d) {
                    if ((t /= d) < (1 / 2.75)) {
                            return c * (7.5625 * t * t) + b
                    } else if (t < (2 / 2.75)) {
                            return c * (7.5625 * (t -= (1.5 / 2.75)) * t + .75) + b
                    } else if (t < (2.5 / 2.75)) {
                            return c * (7.5625 * (t -= (2.25 / 2.75)) * t + .9375) + b
                    } else {
                            return c * (7.5625 * (t -= (2.625 / 2.75)) * t + .984375) + b
                    }
            },
            easeInOutBounce: function(x, t, b, c, d) {
                    if (t < d / 2) return jQuery.easing.easeInBounce(x, t * 2, 0, c, d) * .5 + b;
                    return jQuery.easing.easeOutBounce(x, t * 2 - d, 0, c, d) * .5 + c * .5 + b
            }
    }); 
      

  4.   

    LZ,JS重新排版不会导致JS失去基本功效。
    推荐个网址,LZ试试重新排版
    http://tool.chinaz.com/Tools/JsFormat.aspx
      

  5.   

    哥们,怎么重新排版呀,上个图介绍下好不?
    我想把前面的代码进行编辑,上面的js代码好像是加密了,我改不了
    LZ,你发出来的部分JS代码,其实没有加密,只是排版上压缩了,去掉了所有的回车。
    你只需将你的JS全部贴到那个网址的文本框里,然后点击“格式化”即可。
      

  6.   

    看来我应该把js网址发出来了,我早应该想到这个方法了,只因代码太长,而csdn又发不出那么长的代码,
    http://www.xbiao.com/js/front-new/pub.js
    这个js就是我想要进行编辑的js,
    你们上面说的方法我全部试过了,都不行啊
    现在我把js地址贴出来了,大大们帮帮我吧  谢谢了!
      

  7.   

    LZ,代码是解密了,但是内容过长,这里无法贴上。
    这样吧,提供你一个网址:http://tool.lu/js/,可以进行解密。
    但是解密的内容不是全部的JS。LZ应该将从eval(function(p,a,c,k,e,d)开始直到最后的代码做解密,
    前面的部分var _bdhmProtocol = (("https:" == document.location.protocol) ? "https://" : " http://");
    document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3Fa614a6a498e45b564870acd236f789d4'type='text/javascript'%3E%3C/script%3E"));这一段没有加密
      

  8.   

    他的代码核心就是贝赛尔曲线的算法,楼主可以去百度搜tween