Bài Mới Nhất | Gửi SMS miễn phí | Code ZB | Hỏi Đáp ZB | Chit Chat | Thủ Thuật Blog| Up Hình & TL | Giải Trí |
Welcome Guest [Log In] [Register]


Add Reply
di chuyển và thay đổi kích thước shout box; Codes & Modifications zetaboard f2
Topic Started: 19/05/2010 - 10:19 pm (1,287 Views)
Bietsosothoi
Member Avatar


Thấy code này lạ nữa... mọi người test cho ý kiến nhé
Code:
 

<script type="text/javascript">
/*
* jqDnR - Minimalistic Drag'n'Resize for jQuery.
*
* Copyright (c) 2007 Brice Burgess <bhb@iceburg.net>, http://www.iceburg.net
* Licensed under the MIT License:
* http://www.opensource.org/licenses/mit-license.php
*
* $Version: 2007.08.19 +r2
*/

(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);
</script>
Edited by Bietsosothoi, 19/05/2010 - 10:20 pm.
Posted Image
Offline Profile Quote Post Goto Top
 
Bietsosothoi
Member Avatar


còn code này ai giải thích dùm mình với.
Posted Image
Offline Profile Quote Post Goto Top
 
dread4everyone
Member Avatar
[url]http://k45-4102.org/[/url]

Bietsosothoi
20/05/2010 - 05:44 pm
còn code này ai giải thích dùm mình với.
Khi dùng code hiện cửa sổ emoticon trên shoutbox, bạn dùng thêm code này để di chuyển và thay đổi kích thước của cái sổ ấy
Posted Image
http://k45-4102.org/index
Offline Profile Quote Post Goto Top
 
Bietsosothoi
Member Avatar


bạn cho cái demo. chứ mình chưa hiểu.
Posted Image
Offline Profile Quote Post Goto Top
 
dread4everyone
Member Avatar
[url]http://k45-4102.org/[/url]

Tại khung shoutbox như của tthl ấy, bạn click vào 'Smiles' sẽ có cửa sổ emoticon . Nếu như không dùng đoạn scrpit trên thì cái cửa sổ ấy không thể kéo thả ra vị trí khác hoặc là cũng không thể thay đổi kích thước của cái cửa sổ ấy được. :think:
Posted Image
http://k45-4102.org/index
Offline Profile Quote Post Goto Top
 
tvnannhaungayxua


Bietsosothoi
19/05/2010 - 10:19 pm
Thấy code này lạ nữa... mọi người test cho ý kiến nhé
Code:
 

<script type="text/javascript">
/*
* jqDnR - Minimalistic Drag'n'Resize for jQuery.
*
* Copyright (c) 2007 Brice Burgess <bhb@iceburg.net>, http://www.iceburg.net
* Licensed under the MIT License:
* http://www.opensource.org/licenses/mit-license.php
*
* $Version: 2007.08.19 +r2
*/

(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);
</script>
Cho Code nay vao đâu ạ ?
Offline Profile Quote Post Goto Top
 
dragonland


thanh nhiu
Offline Profile Quote Post Goto Top
 
dread4everyone
Member Avatar
[url]http://k45-4102.org/[/url]

tvnannhaungayxua
11/10/2010 - 07:43 pm
Bietsosothoi
19/05/2010 - 10:19 pm
Thấy code này lạ nữa... mọi người test cho ý kiến nhé
Code:
 

<script type="text/javascript">
/*
* jqDnR - Minimalistic Drag'n'Resize for jQuery.
*
* Copyright (c) 2007 Brice Burgess <bhb@iceburg.net>, http://www.iceburg.net
* Licensed under the MIT License:
* http://www.opensource.org/licenses/mit-license.php
*
* $Version: 2007.08.19 +r2
*/

(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);
</script>
Cho Code nay vao đâu ạ ?
Sau đợt update vào hôm 11/06 lên jquery 1.4.2
Cái code kéo thả và resize này không còn tác dụng nữa :k:
Posted Image
http://k45-4102.org/index
Offline Profile Quote Post Goto Top
 
dtgiang251


Trời, code hay vậy mà hỏng hả các bạn
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Tphượt cẩm nang · Next Topic »
Add Reply




Xem tốt nhất trên các trình duyệt FireFox hoặc Google Chrome ở độ phân giải 1024 x 768 pixels.
Diễn đàn là một hệ thống mở, chúng tôi sẽ không chịu trách nhiệm về nội dung đăng tải do người dùng đưa lên.