jquery - Get coordinates of a table and store in a database using PHP -
i have created page , has tables. have made these tables draggable , need store coordinates of table moved on provided area using php. please me out in doing this, couldn't figure out. code of html page is:
<table class="smssecond"><!--bgcolor="#4ab54d"><class="smssecond"-- td bgcolor: bgcolor="#4ab54d"--> <tr style="background-color: #3c3c3c;" > <td colspan="2" width="auto" align="center">ticket info<img id="delete" src="icons/delete.png" height="10" width="10" style="float: right;"/></td> </tr> <!--odd row--> <tr class="oddrow" align="center"><!-- style="color: #000000; font-size: 12px;"--> <td> ticket number </td> <td> hfk-864-69976 </td> </tr> <!--even row--> <tr class="evenrow" align="center"><!--style="color: #000000; font-size: 15px; background-color: #ffffff" --><!--background-color: #a4eaf6--> <td> department </td> <td> support </td> </tr> <!--odd row--> <tr class="oddrow" align="center"> <td> priority </td> <td> p3-normal </td> </tr> <!--even row--> <tr class="evenrow" align="center"> <td> open date , time </td> <td> 2011-02-28 21:24:01 </td> </tr> <!--odd row--> <tr class="oddrow" align="center"> <td> close date , time </td> <td> 2011-02-28 21:24:01 </td> </tr> <!--even row--> <tr class="evenrow" align="center"> <td> total time </td> <td> 00:03:09 </td> </tr> <!--odd row--> <tr class="oddrow" align="center"> <td> ticket spent </td> <td> 00:02:00 </td> </tr> <!--even row--> <tr class="evenrow" align="center"> <td> no. of staff worked </td> <td> 2 </td> </tr> <!--odd row--> <tr class="oddrow" align="center"> <td> ticket status </td> <td> closed </td> </tr> <!--even row--> <tr class="evenrow" align="center"> <td> sla </td> <td> yes </td> </tr> <!--odd row--> <tr class="oddrow" align="center"> <td> type </td> <td> issue </td> </tr> <!--even row--> <tr class="evenrow" align="center"> <td> red flag </td> <td> 0 </td> </tr> <!--odd row--> <tr class="oddrow" align="center"> <td> yellow flag </td> <td> 0 </td> </tr> <!--even row--> <tr class="evenrow" align="center"> <td> orange flag </td> <td> 0 </td> </tr> <!--odd row--> <tr class="oddrow" align="center"> <td> closed </td> <td> harsha p </td> </tr> </table>
the jquery used is:
<script type="text/javascript"> $(document).ready(function(){ $(".smssecond").draggable({containment: ".maincol"});//, revert: true $(".smssecond").click(function(){ $(this).hide(500); }); $(document).bind("contextmenu", function(e) { $('.smssecond').show(500); return false; }); }); </script>
you can use offset to:
get current coordinates of first element in set of matched elements, relative document
var offset = $(".smssecond").offset(); var left = offset.left; var top = offset.top;
depending on needs, position may useful.
Comments
Post a Comment