کد جابجایی متن با ماوس در سایت
کد جابجایی متن با ماوس در سایت با این کد کوتاه میتوانید نوشته ها و یا متنهای تبلیغی , عکس و … خود را در سایت قرار دهید تا زمانی که متن مزاحم کار کاربر در سایت شما شد بتواند ان را با ماوس جا به جا کند و به راحتی در سایت به کاووش بپردازد.البته از این کد میتوان استفاده های دیگه ای هم کرد که بسته به نوع سلیغه شما میباشد.

کد زیر را کپی کنید و در جای مناسب از سایت و وبلاگ خود قرار دهید.
برای ویرایش کد میتوانید از ابزار پیش نمایش کدبازان استفاده نمایید.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
<div style="position:absolute;top:-200%;"><h1><a href="https://www.codebazan.ir/">کدبازان</a></h1></div><style type="text/css">.drag{position:relative;cursor:hand;z-index: 1000;}</style><script type="text/javascript"> var dragobject={ z: , x: , y: , offsetx : null, offsety : null, targetobj : null, dragapproved : , initialize:function(){ document.onmousedown=this.drag document.onmouseup=function(){this.dragapproved=} }, drag:function(e){ var evtobj=window.event? window.event : e this.targetobj=window.event? event.srcElement : e.target if (this.targetobj.className=="drag"){ this.dragapproved=1 if (isNaN(parseInt(this.targetobj.style.left))){this.targetobj.style.left=} if (isNaN(parseInt(this.targetobj.style.top))){this.targetobj.style.top=} this.offsetx=parseInt(this.targetobj.style.left) this.offsety=parseInt(this.targetobj.style.top) this.x=evtobj.clientX this.y=evtobj.clientY if (evtobj.preventDefault) evtobj.preventDefault() document.onmousemove=dragobject.moveit } }, moveit:function(e){ var evtobj=window.event? window.event : e if (this.dragapproved==1){ this.targetobj.style.left=this.offsetx+evtobj.clientX-this.x+"px" this.targetobj.style.top=this.offsety+evtobj.clientY-this.y+"px" return false } } } dragobject.initialize() </script> <html> <head> <!--drag engine code installed here--> </head> <body> <h1><div style="color:red;border:5px solid red;border-radius:5px;width:50%;background-color:#111;padding:10;"class="drag"> <!------شروع ,ویرایش نوشته شما------> http//:codebazan.ir</div> </body> </html> |