\u3053\u306e\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3067\u306f\u3001p\u3092\u79fb\u52d5\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n
\u8a73\u3057\u3044\u89e3\u8aac\u306f\u5f8c\u306b\u56de\u3059\u3068\u3057\u3066\u3001\u4e00\u65e6\u3001\u30b3\u30fc\u30c9\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n
<p class="draggable"><\/p><\/code><\/pre><\/div>\n\n\n\ninteract('.draggable')\n .draggable({\n \/\/ \u6163\u6027\u3042\u308a\u306e\u3068\u304dtrue, \u6163\u6027\u306a\u3057\u306e\u3068\u304dfalse\n inertia: true,\n \/\/ \u7bc4\u56f2\u3092\u5236\u9650\u3059\u308b\u3068\u304d\u306b\u6307\u5b9a\n restrict: {\n restriction: "parent", \/\/ \u89aa\u8981\u7d20\u3092\u7bc4\u56f2\u306b\u6307\u5b9a\n endOnly: true, \/\/ true\u3092\u6307\u5b9a\u3057\u305f\u5834\u5408\u3001\u30c9\u30ed\u30c3\u30d7\u3057\u305f\u77ac\u9593\u306b\u7bc4\u56f2\u3092\u8d85\u3048\u3066\u3044\u308b\u3068\u304d\u3001\u7bc4\u56f2\u5185\u306b\u623b\u3059\n elementRect: { top: 0, left: 0, bottom: 1, right: 1 } \/\/ \u666e\u901a\u306f\u3053\u306e\u8a2d\u5b9a\u3067\u3044\u3044\u3002\u8a73\u7d30\u306f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3092\u53c2\u7167\u3002\n },\n \/\/ \u30b9\u30af\u30ed\u30fc\u30eb\u304c\u5fc5\u8981\u306a\u7bc4\u56f2\u306b\u30c9\u30e9\u30c3\u30b0\u3057\u305f\u3068\u304d\u3001\u81ea\u52d5\u7684\u306b\u30b9\u30af\u30ed\u30fc\u30eb\u3059\u308b\n autoScroll: true,\n \/\/ call this function on every dragmove event\n onmove: function(event){\n \/\/ drag\u3055\u308c\u3066\u3044\u308b\u8981\u7d20\n var target = event.target;\n \/\/ data\u5c5e\u6027\u304b\u3089\u4eca\u306e\u4f4d\u7f6e\u3092\u53d6\u5f97\u3057\u3066\u3001\u79fb\u52d5\u5206\u3092\u8db3\u3059\n var x = (parseFloat(target.getAttribute('data-x')) || 0) + event.dx;\n var y = (parseFloat(target.getAttribute('data-y')) || 0) + event.dy;\n \/\/ \u4f4d\u7f6e\u3092\u5909\u66f4\n target.style.webkitTransform =\n target.style.transform =\n 'translate(' + x + 'px, ' + y + 'px)';\n \/\/ \u4f4d\u7f6e\u3092data\u5c5e\u6027\u306b\u4fdd\u6301\n target.setAttribute('data-x', x);\n target.setAttribute('data-y', y);\n },\n \/\/ call this function on every dragend event\n onend: function (event) {\n\u3000\u3000\u3000\/\/ \u7d42\u4e86\u3057\u305f\u3068\u304d\u306e\u51e6\u7406\n }\n });<\/code><\/pre><\/div>\n\n\n\n<\/span>\u89e3\u8aac<\/span><\/h2>\n\n\n\n\u5404\u30aa\u30d7\u30b7\u30e7\u30f3\u306f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3092\u898b\u308c\u3070\u5206\u304b\u308a\u3084\u3059\u304f\u66f8\u3044\u3066\u3042\u308b\u306e\u3067\u3001\u30b3\u30e1\u30f3\u30c8\u3092\u53c2\u8003\u306b\u898b\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n
interact.js\u306f\u30a4\u30d9\u30f3\u30c8\u3092\u53d6\u5f97\u3057\u3066\u304f\u308c\u308b\u3060\u3051\u3067\u3001\u5b9f\u969b\u306b\u79fb\u52d5\u3059\u308b\u30b3\u30fc\u30c9\u306fonmove<\/code>\u3084onend<\/code>\u3067\u81ea\u5206\u3067\u66f8\u304b\u306a\u304f\u3066\u306f\u3044\u3051\u307e\u305b\u3093\u3002<\/p>\n\n\n\n\u4f8b\u3048\u3070\u3001\u79fb\u52d5\u306e\u5834\u5408\u306f\u30de\u30a6\u30b9\u304c\u52d5\u3044\u305f\u6642\u3001\u79fb\u52d5\u3057\u305f\u5206\u3060\u3051\u3001CSS\u306etranslate<\/code>\u306e\u5024\u3092\u5909\u66f4\u3057\u3066\u3001\u79fb\u52d5\u3057\u3066\u3044\u308b\u3088\u3046\u306b\u898b\u305b\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n\u3082\u3057\u3001\u56de\u8ee2\u3084\u62e1\u5927\u30fb\u7e2e\u5c0f\u3057\u305f\u3044\u5834\u5408\u3082\u540c\u69d8\u306brotate<\/code>\u3084scale<\/code>\u3092\u64cd\u4f5c\u3057\u3066\u8868\u73fe\u3059\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<\/span>\u307e\u3068\u3081<\/span><\/h2>\n\n\n\n\u81ea\u5206\u3067\u5b9f\u969b\u306e\u51e6\u7406\u3092\u66f8\u304b\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u306e\u306f\u3001\u9762\u5012\u306a\u4e00\u65b9\u3067\u3001\u51e6\u7406\u306e\u5185\u5bb9\u3092\u304b\u306a\u308a\u81ea\u7531\u5ea6\u9ad8\u304f\u4f5c\u308c\u308b\u306e\u3067\u3001\u3044\u308d\u3044\u308d\u8a66\u3057\u3066\u307f\u308b\u3068\u9762\u767d\u3044\u3053\u3068\u304c\u3044\u308d\u3044\u308d\u3067\u304d\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"
\u30e6\u30fc\u30b6\u306e\u624b\u306b\u3088\u3063\u3066<div>\u30bf\u30b0\u306e\u5927\u304d\u3055\u3084\u4f4d\u7f6e\u3092\u3001\u30c9\u30e9\u30c3\u30b0\u3057\u3066\u79fb\u52d5\u3084\u62e1\u5927\u3055\u305b\u305f\u3044\u3068\u304d\u3001\u7c21\u5358\u306b\u5b9f\u88c5\u3067\u304d\u308bInteract.js\u306e\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002\u3061\u3083\u3093\u3068\u30b9\u30de\u30db\u3067\u3082\u52d5\u4f5c\u78ba\u8a8d\u3067\u304d\u305f\u306e\u3067\u3053\u306e\u3088\u3046\u306aUI\u304c\u5fc5\u8981\u306a\u3068\u304d\u3001\u5fc5\u8981 […]<\/p>\n","protected":false},"author":1,"featured_media":208501,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[41,5],"tags":[166,43,165,167],"class_list":["post-4305","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-javascript","category-program","tag-interactjs","tag-javascript","tag-js-library","tag-ui"],"aioseo_notices":[],"jetpack_featured_media_url":"http:\/\/cms.inter-arteq.com\/wp-content\/uploads\/2022\/03\/how-to-create-dom-interaction-on-web-with-interact-js.png","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"http:\/\/cms.inter-arteq.com\/wp-json\/wp\/v2\/posts\/4305"}],"collection":[{"href":"http:\/\/cms.inter-arteq.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/cms.inter-arteq.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/cms.inter-arteq.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/cms.inter-arteq.com\/wp-json\/wp\/v2\/comments?post=4305"}],"version-history":[{"count":4,"href":"http:\/\/cms.inter-arteq.com\/wp-json\/wp\/v2\/posts\/4305\/revisions"}],"predecessor-version":[{"id":208502,"href":"http:\/\/cms.inter-arteq.com\/wp-json\/wp\/v2\/posts\/4305\/revisions\/208502"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/cms.inter-arteq.com\/wp-json\/wp\/v2\/media\/208501"}],"wp:attachment":[{"href":"http:\/\/cms.inter-arteq.com\/wp-json\/wp\/v2\/media?parent=4305"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/cms.inter-arteq.com\/wp-json\/wp\/v2\/categories?post=4305"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/cms.inter-arteq.com\/wp-json\/wp\/v2\/tags?post=4305"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}