|
 |
|
สอบถามเรื่อง Drag-and-Drop แล้วบันทึกค่าตำแหน่งที่วางล่าสุดลงฐานข้อมูลหน่อยครับ |
|
 |
|
|
 |
 |
|
apply หน่อยสิครับ แหม่..ไม่ได้ยากขนาดนั้น
Code (PHP)
<html lang="en">
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/jquery-ui.min.js"></script>
</head>
<style>
#makeMeDraggable { width: 50px; height: 50px; background: red; }
</style>
<script type="text/javascript">
$( init );
$('#makeMeDraggable').draggable( {
eventName: eventHandler,
} );
function init() {
$('#makeMeDraggable').draggable( {
cursor: 'move',
containment: 'document',
stop: handleDragStop
} );
}
function handleDragStop( event, ui ) {
var offsetXPos = parseInt( ui.offset.left );
var offsetYPos = parseInt( ui.offset.top );
//alert( "Drag stopped!\n\nOffset: (" + offsetXPos + ", " + offsetYPos + ")\n");
$('#offsetXPos').val(offsetXPos);
$('#offsetYPos').val(offsetYPos);
}
</script>
<body>
<form action="your_file.php" method="post" name="frm">
offsetXPos <input type="text" name="offsetXPos" id="offsetXPos"><br />
offsetYPos <input type="text" name="offsetYPos" id="offsetYPos"><br />
<input type="submit" id="save" name="save" value="Save">
</form>
<div id="content" style="height: 400px;">
<div id="makeMeDraggable"> </div>
</div>
</body>
</html>
|
 |
 |
 |
 |
Date :
2014-01-08 14:20:34 |
By :
mangkunzo |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณครับ
|
 |
 |
 |
 |
Date :
2014-01-09 09:29:11 |
By :
phionixz |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 01
|