Ticket/InsdepUI/plugin/cropper-2.3.4/examples/responsive-container.html

(完整代码) 1KB

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Cropper</title>
  <link rel="stylesheet" href="../assets/css/bootstrap.min.css">
  <link rel="stylesheet" href="../dist/cropper.css">
  <style>
    .container {
      max-width: 960px;
      margin: 20px auto;
    }

    .img-container {
      width: 100%;
      margin-top: 10px;
    }

    .img-container img {
      width: 100%;
    }
  </style>
</head>
<body>

  <div class="container">
    <h1 class="page-header">Cropper with responsive container</h1>
    <button type="button" class="btn btn-primary" id="replace">Replace Image</button>
    <div class="img-container">
      <img src="../assets/img/picture.jpg" alt="Picture">
    </div>
  </div>

  <!-- Scripts -->
  <script src="../assets/js/jquery.min.js"></script>
  <script src="../assets/js/bootstrap.min.js"></script>
  <script src="../dist/cropper.js"></script>
  <script>
    $(function () {
      var $image = $('.img-container > img');

      $image.cropper({
        movable: false,
        zoomable: false,
        rotatable: false,
        scalable: false
      });

      $('#replace').on('click', function () {
        $image.cropper('replace', '../assets/img/picture-2.jpg');
      });
    });
  </script>
</body>
</html>

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。