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

一月13日

2012-11-22 
1月13日jquery之窗口拖动:?$(#inner).mousedown(function(event){???var offset $(this).offset()???

1月13日

jquery之窗口拖动:

?

$('#inner').mousedown(function(event){
???var offset = $(this).offset();
???_x=event.clientX-offset.left;
???_y=event.clientY-offset.top;
???$('#out').css({'top':offset.top+'px'});
???$('#out').mousemove(function(event){
???var temp = $("#out");
???_xx=event.clientX-_x;
???_yy=event.clientY-_y;
???temp.css({left:_xx,top:_yy});
//???this.style.left=_xx;
//???this.style.top=_yy;
???this.style.zIndex=100;//这里的this是指向哪的
???return false;//方法执行完后返回false最好
???});
???return false;
});
$("#out").mouseup(function(){

$(this).unbind("mousemove");

$(this).css({'z-index':'-1'});

return false;

});

热点排行