diff --git a/frame.js b/frame.js index c80de70b..600eab90 100644 --- a/frame.js +++ b/frame.js @@ -677,7 +677,12 @@ Volcanos("onmotion", {help: "动态特效", list: [], _init: function(can, targe }) }, move: function(can, target, layout) { var begin + target.onmousedown = function(event) { + layout.width = target.offsetWidth + layout.height = target.offsetHeight + layout.left = target.offsetLeft + layout.top = target.offsetTop begin = {x: event.x, y: event.y, left: layout.left, top: layout.top, width: layout.width, height: layout.height} }, target.onmouseup = function(event) { begin = null } diff --git a/plugin/story/spide.js b/plugin/story/spide.js index 5a1cd9a6..445f5236 100644 --- a/plugin/story/spide.js +++ b/plugin/story/spide.js @@ -156,7 +156,9 @@ Volcanos("ondetail", {help: "用户交互", list: [], sub.Conf("height", height+120) } - can.page.Modify(can, sub._target, {style: {position: "fixed", left: left+margin, top: top}}) + var layout = {position: "fixed", left: left+margin, top: top} + can.onmotion.move(can, sub._target, layout) + can.page.Modify(can, sub._target, {style: layout}) can.page.Modify(can, sub._output, {style: {"max-width": width-margin*2}}) can.base.isFunc(cb) && cb(msg) })