[英]Kendo Editor - Javascript function call on dynamically generated HTML elements
I have Kendo Editor implemented in my website. 我在网站上实现了Kendo编辑器。 Now I want to add events on dynamically generated DOM elements in kendo editor (eg. Click event on image). 现在,我想在Kendo编辑器中在动态生成的DOM元素上添加事件(例如,图像上的Click事件)。 So how can I do that?? 那我该怎么办呢?
Basically I want to do it for making image resizable and draggable by jquery-ui inside kendo-editor 基本上我想通过kendo-editor中的jquery-ui使图像可调整大小和可拖动
You can do that only if your editor is initialized from a contentEditable element: 仅当您的编辑器是从contentEditable元素初始化的时,您才可以这样做:
<div id="editor" contentEditable>
Logo
<img src="http://www.google.bg/images/srpr/logo4w.png" width=100>
</div>
<script>
$("#editor").kendoEditor();
$("#editor img").draggable({
containment: "parent"
});
</script>
Here is a live demo: http://jsbin.com/ELuhObe/1/edit 这是一个现场演示: http : //jsbin.com/ELuhObe/1/edit
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.