0
나는 자동으로 텍스트 블록을 입력하는 jQuery 프로그램을 작성 중이다. 사용자가 "텍스트 지우기 및 기능 다시 시작"기능을 다시 시작하도록 허용하려고합니다.이 작업을 수행하는 방법을 잘 모르겠습니다. 코드는 다음과 같습니다.jQuery 함수를 다시 시작하십시오. onClick
var char = 0;
var caption = "";
var standby
// initiate the Cursor
$(document).ready(function() {
setInterval ("cursorAnimation()", 600);
});
// initiate the Text
$(document).ready(function() {
$('#abouttext').aboutText();
});
// The typing animation
function aboutText() {
$('#abouttext').html(caption.substr(0, captionLength++));
if(captionLength < caption.length+1){
setTimeout("type()",50);
}else{
captionLength = 0;
caption = "";
}
}
// The Restart Button
function restart() {
$('#restartbtn').click(function() {
var typing = $('#abouttext');
}
typing.stop();
// The cursor animation
function cursorAnimation() {
$('.cursor').animate({
opacity : 0
}, "fast", "swing").animate({
opacity : 1
}, "fast", "swing");
}
stop() 함수를 중지해야합니다. 그 후 모든 것을 다시 시작하십시오. 하지만 어떻게해야할지 모르겠다. 어떤 도움이라도 굉장합니다. -감사! 잘