首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Ajax >

帮小弟我看下这段代码,哪里和jquery1.7不兼容了

2012-04-05 
帮我看下这段代码,哪里和jquery1.7不兼容了大家好。下面这段代码实现了拖拽功能,用的是jQuery,在使用jQuery

帮我看下这段代码,哪里和jquery1.7不兼容了
大家好。

下面这段代码实现了拖拽功能,用的是jQuery,在使用jQuery 1.1.3版的时候没什么问题,但使用最新的1.7版就不行了(firebug没有提示出错信息,貌似1.4版本的jQuery也会有问题),我对JavaScript不太熟,所以请大家帮我看一下,多谢了!

JScript code
(function($){$.fn.jqDrag=function(h){return i(this,h,'d');};$.fn.jqResize=function(h){return i(this,h,'r');};$.jqDnR={dnr:{},e:0,drag:function(v){ if(M.k == 'd')E.css({left:M.X+v.pageX-M.pX,top:M.Y+v.pageY-M.pY}); else E.css({width:Math.max(v.pageX-M.pX+M.W,0),height:Math.max(v.pageY-M.pY+M.H,0)});  return false;},stop:function(){E.css('opacity',M.o);$().unbind('mousemove',J.drag).unbind('mouseup',J.stop);}};var J=$.jqDnR,M=J.dnr,E=J.e,i=function(e,h,k){return e.each(function(){h=(h)?$(h,e):e; h.bind('mousedown',{e:e,k:k},function(v){var d=v.data,p={};E=d.e; // attempt utilization of dimensions plugin to fix IE issues if(E.css('position') != 'relative'){try{E.position(p);}catch(e){}} M={X:p.left||f('left')||0,Y:p.top||f('top')||0,W:f('width')||E[0].scrollWidth||0,H:f('height')||E[0].scrollHeight||0,pX:v.pageX,pY:v.pageY,k:d.k,o:E.css('opacity')}; E.css({opacity:0.8});$().mousemove($.jqDnR.drag).mouseup($.jqDnR.stop); return false; });});},f=function(k){return parseInt(E.css(k))||false;};})(jQuery);


[解决办法]
firebug报什么错

热点排行