basic.html 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <title>Hello World | 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. var d = document, ge = 'getElementById';
  10. $('#interface').on('cropmove cropend',function(e,s,c){
  11. d[ge]('crop-x').value = c.x;
  12. d[ge]('crop-y').value = c.y;
  13. d[ge]('crop-w').value = c.w;
  14. d[ge]('crop-h').value = c.h;
  15. });
  16. // Most basic attachment example
  17. $('#target').Jcrop({
  18. setSelect: [ 175, 100, 400, 300 ]
  19. });
  20. $('#text-inputs').on('change','input',function(e){
  21. $('#target').Jcrop('api').animateTo([
  22. parseInt(d[ge]('crop-x').value),
  23. parseInt(d[ge]('crop-y').value),
  24. parseInt(d[ge]('crop-w').value),
  25. parseInt(d[ge]('crop-h').value)
  26. ]);
  27. });
  28. });
  29. </script>
  30. <link rel="stylesheet" href="demo_files/main.css">
  31. <link rel="stylesheet" href="demo_files/demos.css">
  32. <link rel="stylesheet" href="../css/Jcrop.css">
  33. <style>
  34. #text-inputs { margin: 10px 8px 0; }
  35. .input-group { margin-right: 1.5em; }
  36. .nav-box { width: 748px; padding: 0 !important; margin: 4px 0; background-color: #f8f8f7; }
  37. </style>
  38. </head>
  39. <body>
  40. <div class="navbar navbar-fixed-top">
  41. <div class="navbar-inner">
  42. <div class="container">
  43. <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>
  44. <div class="nav-collapse collapse">
  45. <ul class="nav">
  46. <li class="active"><a href="./basic.html">Demos</a>
  47. </li>
  48. <li><a href="http://beta.jcrop.org/doc/">Docs</a>
  49. </li>
  50. <li><a href="http://beta.jcrop.org/contact/">Contact</a>
  51. </li>
  52. </ul>
  53. </div>
  54. </div>
  55. </div>
  56. </div>
  57. <div class="container">
  58. <div class="row">
  59. <div class="span12">
  60. <div class="jc-demo-box">
  61. <div class="page-header">
  62. <h1>Hello World</h1>
  63. </div>
  64. <div class="demo-nav menu-box">
  65. <h3>Jcrop Demos</h3>
  66. <ul class="links">
  67. <li><b>Hello World</b></li>
  68. <li><a href="thumbnail.html">Thumbnail Preview</a></li>
  69. <li><a href="panel.html">Feature Panel</a></li>
  70. <li><a href="coords.html">Dimensions</a></li>
  71. <li><a href="circle.html">Circles</a></li>
  72. </ul>
  73. </div>
  74. <div id="interface" class="page-interface"><img src="http://jcrop-cdn.tapmodo.com/assets/images/sierra2-750.jpg" id="target"></div>
  75. <div class="nav-box">
  76. <form onsubmit="return false;" id="text-inputs"><span class="input-group"><b>X</b>
  77. <input type="text" name="cx" id="crop-x" class="span1"></span><span class="input-group"><b>Y</b>
  78. <input type="text" name="cy" id="crop-y" class="span1"></span><span class="input-group"><b>W</b>
  79. <input type="text" name="cw" id="crop-w" class="span1"></span><span class="input-group"><b>H</b>
  80. <input type="text" name="ch" id="crop-h" class="span1"></span>
  81. </form>
  82. </div>
  83. <div class="tapmodo-footer"><a href="http://tapmodo.com" class="tapmodo-logo segment">tapmodo.com</a>
  84. <div class="segment"><b>&copy; 2008-2013 Tapmodo Interactive LLC</b>
  85. <div>Jcrop is free software released under <a href="../MIT-LICENSE.txt">MIT License</a></div>
  86. </div>
  87. </div>
  88. <div class="clearfix"></div>
  89. </div>
  90. </div>
  91. </div>
  92. </div>
  93. </body>
  94. </html>