box-sizing.html 4.0 KB

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