Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Online Bootstrap Editor

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>jQuery UI Draggable - Default functionality</title>
  <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
  <link rel="stylesheet" href="/resources/demos/style.css">
  <style>
  #draggable { width: 150px; height: 150px; padding: 0.5em; }
  .Page {
            box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
            width : 80%;
            height : 700px;
            padding: 5%;
            background-color: yellow;
            
            
    }
  </style>
  <script src="https://code.jquery.com/jquery-1.12.4.js"></script>
  <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
  <script>
  $( function() {
    $( "#draggable" ).draggable();
      $( "#draggable" ).resizable();
  } );
  </script>


    <!-- Bootstrap -->
    <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css" rel="stylesheet">

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>

<body>
    <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
  <link rel="stylesheet" href="/resources/demos/style.css">
  <style>
     #draggable { width: 150px; height: 150px; padding: 0.5em; }
    .Page {
            box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
            width : 80%;
            height : 700px;
            padding: 5%;
            background-color: yellow;
            
            
    }
  </style>
  <script src="https://code.jquery.com/jquery-1.12.4.js"></script>
  <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
  <script>
  $( function() {
    $( "#draggable" ).draggable();
      $( "#draggable" ).resizable();
  } );
  </script>

    <style>
        .categoryRow
    	{
    		background-color:green;
    		color:white;
    		font-size:15px;
    	}
            
        .categoryDetailRow
    	{
    		
    		color:black;
    		font-size: 11px;
    	
    	}    
    	.data
    	{
    	    	 text-decoration: underline;
    	}
    </style>
    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>
   <div class="Page">
	 <div id="draggable" class="ui-widget-content">
	    <!--<table id="display" class="table" width="100%" height="100%">
        	<thead>
	            <tr>
        	        <th></th>
                	<th>WEIGHT</th>
	                <th>SCORE</th>
        	        <th>QUARTRE</th>
	            </tr>
        	</thead>
    	     </table>
    	     -->
	</div>
 </div>


<script>
    var data= {  "title" : "Testing",
          "categorys" :
          [
            {
              "name" : "Environment",
              "detail" :
              [
                {
                  "dname" : "Electornic Waste",
                  "weight" : "10.0",
                  "score" : "2.9",
                  "quartre" : "**"
                },  
                {
                  "dname" : "Opportuniteis Clean Tech",
                  "weight" : "10.0",
                  "score" : "2.9",
                  "quartre" : "**"
                }
                  
                
              ]
            },
            {
              "name" : "Social",
              "detail" :
              [
                {
                  "dname" : "Human Capital Development",
                  "weight" : "10.0",
                  "score" : "2.9",
                  "quartre" : "**"
                },  
                {
                  "dname" : "Supply Chain labour",
                  "weight" : "10.0",
                  "score" : "2.9",
                  "quartre" : "**"
                }
                  
                
              ]
            }
            
          ]
        }

    
    /* var table=   document.getElementById("display");
     
       
        nos=data.categorys.length;
        
      
     
    for ( var i =0; i < nos;i++)
    {
        //alert("dd2");
        posToAddAt=table.rows.length;
        row=table.insertRow(posToAddAt);
        row.classList.add("categoryRow");
        cell=row.insertCell(0);
        cell.innerHTML=data.categorys[i].name;
        cellWeight=row.insertCell(1);
        cellWeight.innerHTML="";
        cellScore=row.insertCell(2);
        cellScore.innerHTML="";
        cell=row.insertCell(3);
        cell.innerHTML="";    
        dLength=data.categorys[i].detail.length;
        for(d=0; d < dLength;d++)
        {
                posToAddAt=table.rows.length;
                row=table.insertRow(posToAddAt);
                row.classList.add("categoryDetailRow");
                cell=row.insertCell(0);
                cell.innerHTML=data.categorys[i].detail[d].dname;
                cellWeight=row.insertCell(1);
                cellWeight.innerHTML=data.categorys[i].detail[d].wight;;
                cellScore=row.insertCell(2);
                cellScore.innerHTML=data.categorys[i].detail[d].score;
                cellQ=row.insertCell(3);
                cellQ.innerHTML=data.categorys[i].detail[d].quartre;;    
            
        }
  
    
    }
   
    table.border=1;*/
</script>
</body>
</html>

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.