我正在尝试添加一个可点击的div到sceditor。基本要求是使用所见即所得,并以编程方式将一个元素添加到编辑器中,当用户单击它时,编辑器可以显示弹出窗口。
为此,我使用:
var text = "<div onClick='editdiv(this)'>"+name+"</div>";▓
$('.sceditor').sceditor('instance').insert(text);
这会将div插入到编辑器中,但当我单击它时,我得到一个错误消息,指出editdiv未定义。而edit
我在应用程序中放入了一个全局模式的“正在加载,请等待”<div>。它会在每次单击<a>或<input type="button">时显示。这是通过在onload中为<body>分配一个onclick事件处理程序来实现的,这样它就会在事件出现时执行:
<body onload="setup()">
<!-- No control over what will be here -->
</body>
<script>
function setup() {
下面是我的html。
// consider all are of same size
<div id="grand-parent">
<div id="parent">
<div id = "child">
</div>
</div>
</div>
Javascript。
$("#grand-parent").click(function(){
alert("grand-parent");
});
我有以下div:
<div class='amazingmenu' id='menupull'>
<img src='images/down.png' width=20 height=20 align='right'/>
<div id='menupullhideme'>click the arrow to read the rest!<br /></div>
more jokes on <a href='http:/