Home
Posts RSS
Comments RSS
YOUR-LINK-TITLE
YOUR-LINK-TITLE
YOUR-LINK-TITLE
YOUR-LINK-TITLE
YOUR-LINK-TITLE
Belajar Pemrograman Web dengan Javascript Effect
Tips Trick mudah dan cepat Belajar Pemrograman Web dengan Javascript, PHP, ASP, CSS, XML dengan menerapkan Technology AJAX dan JQuery
YOUR-LINK-TITLE
YOUR-LINK-TITLE
YOUR-LINK-TITLE
YOUR-LINK-TITLE
YOUR-LINK-TITLE
YOUR-LINK-TITLE
YOUR-LINK-TITLE
YOUR-LINK-TITLE
YOUR-LINK-TITLE
YOUR-LINK-TITLE
YOUR-LINK-TITLE
YOUR-LINK-TITLE
YOUR-LINK-TITLE
YOUR-LINK-TITLE
YOUR-LINK-TITLE
YOUR-LINK-TITLE
Script Drag and Drop dengan Javascript
18.58
Diposting oleh
The Dreamer
Step 1:
Sisipkan script berikut ini kedalam html kamu..
<style type="text/css">
.drag{
position:relative;
cursor:hand;
z-index: 100;
}
</style>
<script type="text/javascript">
/***********************************************
* Drag and Drop Script: © Dynamic Drive (http://topjavascript.blogspot.com/)
* This notice MUST stay intact for legal use
* Visit http://topjavascript.blogspot.com/ for this script and 100s more.
***********************************************/
var dragobject={
z: 0, x: 0, y: 0, offsetx : null, offsety : null, targetobj : null, dragapproved : 0,
initialize:function(){
document.onmousedown=this.drag
document.onmouseup=function(){this.dragapproved=0}
},
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=0}
if (isNaN(parseInt(this.targetobj.style.top))){this.targetobj.style.top=0}
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>
Javascript effect
You can
leave a response
, or trackback from your own site.
0 Response to "Script Drag and Drop dengan Javascript"
Posting Komentar
Posting Lebih Baru
Beranda
Langganan:
Posting Komentar (Atom)
featured-video
PDF Repair Manual Car and Motorcycles Guide
Memuat...
Ebook Manual Car
Free Template
Interior Guide
Automotive Repair Guide
0 Response to "Script Drag and Drop dengan Javascript"