我正在使用ckeditor显示格式化文本。我正在使用Asp.net mvc 3剃刀辅助方法Html.CKEditorFor(x => x.Description)用于上述目的。需要实现这个ckeditor.I的 水印功能正在使用为目的下面的代码,焦点事件不使用CKEditor从文本框触发
$("#Description").focus(function() {
$(this).filter(function() {
// We only want this to apply if there's not
// something actually entered
return $(this).val() == "" || $(this).val() == "Type here"
}).removeClass("watermarkOn").val("");
});
但是,当我专注于CKEditor的textbox.So我使用Firebug检查该文档的焦点事件不火,并发现默认文本呈现在由mvc ckeditor helper生成的以下类('cke_show_borders')中。因此,我将上面的代码修改为
$(".cke_show_borders").focus(function() {
$(this).filter(function() {
// We only want this to apply if there's not
// something actually entered
return $(this).val() == "" || $(this).val() == "Type here"
}).removeClass("watermarkOn").val("");
});
但仍然焦点事件没有解雇。 我要去哪里请帮忙。 谢谢。
大家的变薄一直不停在文档就绪功能中。 – user1045002