1

I am trying to append an html file into a div

marked solution in this thread helped me to add html file to my page

But I want the loaded content to be stretch and fit to the div. How to achieve this?

I cannot edit the appended html file since it is generated dynamically in the real case.

Can somebody help me in this ?

bellow is my workaround

<html lang="en">
<head>
  <meta charset="utf-8">
  <title>jQuery UI Resizable - Animate</title>
  <link rel="stylesheet" href="http://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
  <script src="http://code.jquery.com/jquery-1.10.2.js"></script>
  <script src="http://code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
  <link rel="stylesheet" href="/resources/demos/style.css">
  <style>
  #resizable { width: 150px; height: 150px; padding: 0.5em; }
  #resizable h3 { text-align: center; margin: 0; }
  .ui-resizable-helper { border: 1px dotted gray; }
  </style>
  <script>
  $(function() {
    $( "#resizable" ).resizable({
      animate: true
    });
 $( "#resizable" ).draggable({
      animate: true
    });
  });
  </script>
  <script> 
  debugger;
    $(function(){
      $("#includedContent").load("b.html"); 
    });
    </script> 
</head>
<body>
 
<div id="resizable" class="ui-widget-content">
  <h3 class="ui-widget-header">Animate</h3>
   <div id="includedContent"></div>
</div>
</body>
</html>
Community
  • 1
  • 1
Anoop M V
  • 21
  • 5

0 Answers0