Monday 7 September 2015

Drag and drop in jquery

<!doctype html>

<html lang="en">

<head>

<meta charset="utf-8">





<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">

<script src="//code.jquery.com/jquery-1.10.2.js"></script>

<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>

<link rel="stylesheet" href="/resources/demos/style.css">

<style>

#sortable {

list-style-type: none;

margin: 0;

padding: 0;

width: 60%;



}

#sortable li {

margin: 0 3px 3px 3px;

padding: 0.4em;

padding-left: 1.5em;

font-size: 1.4em;

height: 18px;



}

#sortable li span {

position: absolute;

margin-left: -1.3em;



}

</style>

<script>

$(function() {

$( "#sortable" ).sortable();

$( "#sortable" ).disableSelection();



});

</script>

</head>

<body>

<table width="100%">

<thead>

<tr>

<th>EID</th>

<th>NAME</th>

</tr>

</thead>

<tbody id="sortable">

<tr class ="ui-state-default">

<td>1</td>

<td>Item 1</td>

</tr>

<tr class="ui-state-default">

<td>2</td>

<td>Item 2</td>

</tr>

</tbody>

</table>





 

 

 

</body>

</html>

No comments:

Post a Comment