Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //fuction tow how header html
- function showHeader(){
- $url_save = $_SERVER['PHP_SELF'].'?action=save';
- $ret ='
- <html>
- <head>
- <title>
- Drag Drop JQueryUI
- </title>
- <link href="css/style.css" rel="stylesheet" type="text/css" />
- <script src="js/jquery/jquery-1.6.1.min.js" type="text/javascript" language="javascript"></script>
- <script src="js/jquery-ui/jquery-ui-1.7.1.custom.min.js" type="text/javascript" language="javascript"></script>
- <script type="text/javascript">
- $(document).ready(function() {
- $(\'.column_builder\').sortable({
- connectWith: \'.column_builder\',
- handle: \'h2\',
- cursor: \'move\',
- placeholder: \'placeholder\',
- forcePlaceholderSize: true,
- opacity: 0.6,
- stop: function(event, ui){
- savePosition();
- }
- }).disableSelection();
- });
- function savePosition(){
- var items = [];
- $(".column_builder").each(function(){
- var columnId = $(this).attr("id");
- $(".item", this).each(function(i){ //order mulai dari 0
- var item = {
- id: $(this).attr("id"),
- column: columnId,
- order: i+1
- }
- items.push(item);
- });
- });
- $("#process").html("saving...");
- var shortorder = {items : items};
- $.ajax({
- url: "'.$url_save.'",
- async: false,
- data: shortorder,
- dataType: "html",
- type: "POST",
- success: function(html){
- $("#process").html(html);
- }
- });
- }
- </script>
- </head>
- <body>';
- return $ret;
- }
Advertisement
Add Comment
Please, Sign In to add comment