형식화 된 텍스트를 표시하기 위해 ckeditor를 사용하고 있습니다. 위의 목적으로 Asp.net mvc 3 면도기 도우미 메서드 Html.CKEditorFor (x => x.Description)를 사용하고 있습니다 .I , 목적을 위해 다음 코드를 사용하고이 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 해고하지 않고 기본 텍스트가 mvc ckeditor helper에 의해 생성 된 다음 클래스 ('cke_show_borders') 안에 렌더링 된 것을 발견했습니다. 위 코드를
로 수정했습니다. 10$(".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("");
});
그러나 여전히 포커스 이벤트가 발생하지 않습니다. 내가 잘못 가고있어 pls는 긴급한 도움을줍니다. 감사합니다. .
$(function() {
$('.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('');
});
});
안녕 모든 돼고가 유지되었습니다
덧붙여, 내가 본 사람들은 같은 것을 사용하여 CKEditor의 기본 동작을 변경 문서 준비 기능에서. – user1045002