DIV 中的拖动问题
在 DIV 标记中,我在加载时使用以下脚本附加了一个 SPAN 控件,
$("#<%=divDimensions.ClientID %>").append("<SPAN id='spnDrag' class='draggable' style='CURSOR:hand'>" + $(ui.draggable).text() + "</SPAN><br>");
其中“divDimensions”是 DIV 控件。
我编写的用于拖动上面创建的跨度控件的 jquery 脚本如下:
$("#<%= divDimensions.ClientID%> SPAN.draggable").draggable({
appendTo: 'body',
helper: 'clone',
scroll: false,
drag: function() {
$('#<%=hdnNodeType.ClientID%>').val("DimensionBox");
}
});
但问题是我无法拖动创建的跨度控件。你能帮我解决这个问题吗?
关于拖动的另一个问题是,在 FusionChart 控件上拖动时,可拖动元素会消失,我必须将其拖动到 FusioChart 附近。在 FusionChart 上拖拽的解决方案是什么?
In a DIV tag, I had appended a SPAN control by using the following script, at load
$("#<%=divDimensions.ClientID %>").append("<SPAN id='spnDrag' class='draggable' style='CURSOR:hand'>" + $(ui.draggable).text() + "</SPAN><br>");
where "divDimensions" is the DIV control.
And the jquery script I had wriiten for dragging the span control created above is as follows :
$("#<%= divDimensions.ClientID%> SPAN.draggable").draggable({
appendTo: 'body',
helper: 'clone',
scroll: false,
drag: function() {
$('#<%=hdnNodeType.ClientID%>').val("DimensionBox");
}
});
But the issue is that I am unable to drag the span control created. Can you help me resolve this ?
And another issue regarding dragging is that, the draggable element gets disappeared while dragging over the FusionChart control, which I had to drag near to the FusioChart. Whats the solution for draggign over the FusionChart ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该通过在结束标记前添加减号来抑制 erb 输出中的换行符。
始终查看 JavaScript 控制台。它是查找错误的好工具。
You should suppress line breaks in erb output by adding a minus sign before the closing tags.
Always have a look at the JavaScript console. It's a great tool to find bugs.