non-image.html 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <title>Non-image Cropping | Jcrop Demos</title>
  5. <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
  6. <script src="../js/Jcrop.js"></script>
  7. <script type="text/javascript">
  8. jQuery(function($){
  9. // I did JSON.stringify(jcrop_api.ui.selection.get()) on a crop I liked:
  10. var c = {"x":186,"y":218,"x2":564,"y2":281,"w":378,"h":63};
  11. $('#target').Jcrop({
  12. setSelect: [c.x,c.y,c.w,c.h]
  13. },function(){
  14. this.animateTo([ 18, 11, 713, 170 ]);
  15. });
  16. });
  17. </script>
  18. <link rel="stylesheet" href="demo_files/main.css">
  19. <link rel="stylesheet" href="demo_files/demos.css">
  20. <link rel="stylesheet" href="../css/Jcrop.css">
  21. <style>
  22. #target {
  23. background-color: #ccc;
  24. width: 750px;
  25. height: 500px;
  26. display: block;
  27. }
  28. #target p {
  29. padding: .5em 1em;
  30. line-height: 1;
  31. font-size: 36px;
  32. display: block;
  33. }
  34. </style>
  35. </head>
  36. <body>
  37. <div class="navbar navbar-fixed-top">
  38. <div class="navbar-inner">
  39. <div class="container">
  40. <button type="button" data-toggle="collapse" data-target="nav-collapse" class="btn btn-navbar"><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button><a href="../" class="brand">Jcrop</a>
  41. <div class="nav-collapse collapse">
  42. <ul class="nav">
  43. <li class="active"><a href="./basic.html">Demos</a>
  44. </li>
  45. <li><a href="http://beta.jcrop.org/doc/">Docs</a>
  46. </li>
  47. <li><a href="http://beta.jcrop.org/contact/">Contact</a>
  48. </li>
  49. </ul>
  50. </div>
  51. </div>
  52. </div>
  53. </div>
  54. <div class="container">
  55. <div class="row">
  56. <div class="span12">
  57. <div class="jc-demo-box">
  58. <div class="page-header">
  59. <h1>Non-image Cropping</h1>
  60. </div>
  61. <div class="demo-nav menu-box">
  62. <h3>Jcrop Demos</h3>
  63. <ul class="links">
  64. <li><a href="basic.html">Hello World</a></li>
  65. <li><a href="thumbnail.html">Thumbnail Preview</a></li>
  66. <li><a href="panel.html">Feature Panel</a></li>
  67. <li><a href="coords.html">Dimensions</a></li>
  68. <li><a href="circle.html">Circles</a></li>
  69. </ul>
  70. </div>
  71. <div id="target" class="jcrop-dark jcrop-hl-active"><p><strong>This is an example of attaching Jcrop to a target that is not an image.</strong>
  72. You are now cropping over &lt;div&gt; content.</p>
  73. </div>
  74. <div class="description"><p><strong>Attaching Jcrop to a non-image element.</strong><br/>This is mostly useful to implement other interfaces, such as
  75. <code>canvas</code> or over an arbitrary <code>div</code>.</p>
  76. </div>
  77. <div class="tapmodo-footer"><a href="http://tapmodo.com" class="tapmodo-logo segment">tapmodo.com</a>
  78. <div class="segment"><b>&copy; 2008-2013 Tapmodo Interactive LLC</b>
  79. <div>Jcrop is free software released under <a href="../MIT-LICENSE.txt">MIT License</a></div>
  80. </div>
  81. </div>
  82. <div class="clearfix"></div>
  83. </div>
  84. </div>
  85. </div>
  86. </div>
  87. </body>
  88. </html>