1
프로토 타입으로 변환하려는 다음 jquery가 있습니다. 난 진짜 레일 애플 리케이션에서 올바르게 초기화하는 방법을 알아낼 수 없기 때문에 일하는 데 몇 가지 진짜 문제가 있습니다.jquery에서 프로토 타입으로 변환
$(document).ready(function(){
/*** Search label ***/
htmlinput = $("input#panel-search").val() /* picks the inital value of the input (in the html) */
$("input#panel-search").css('color','#aeaeae').css('font-style','italic').css('font-weight','bold');
$("input#panel-search").focus(function(){ /* on focus.. */
curinput = $(this).val() /* picks the -current- value */
if(curinput == htmlinput){ /* if the current value corrispond to the initial value (htmlinput var) */
$(this).val(''); /* empty the input */
$(this).css('color','black').css('font-style', 'normal').css('font-weight','normal');
}
});
$("input#panel-search").blur(function(){ /* on blur */
curinput = $(this).val();
if(curinput == ''){ /* if the current value is null .. */
$(this).css('color','#aeaeae').css('font-style','italic').css('font-weight','bold');
$(this).val(htmlinput); /* sets the value with its inital value (htmlinput var) */
}
})
/* Main Navigation hover effect */
$("ul#navigation li:not('.current'), ul#navigation li:not('highlighted')").hover(
function() {
$(this).addClass("hover");
},
function() {
$(this).removeClass("hover");
}
);
/* Right Menu hover effect */
$("ul#fast-links li:not('.current')").hover(
function() {
$(this).addClass("current");
},
function() {
$(this).removeClass("current");
}
);
});
모든 도움을 주시면 감사하겠습니다.
나는 당신이 뭘 원하는지 이해할 수 없다. 단일 함수의 내용을 우리에게 보냈는데 어떻게 프로토 타입으로 변환하려고합니까? –