Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force line breaks - Possible? #21

Open
srikat opened this issue Apr 9, 2017 · 2 comments
Open

Force line breaks - Possible? #21

srikat opened this issue Apr 9, 2017 · 2 comments

Comments

@srikat
Copy link

srikat commented Apr 9, 2017

Hello,

Is it possible to make the following work?

strings:['I don\'t want just words.<br/>If that\'s all you have for me, you\'d better go.<br/>F. SCOTT FITZGERALD'],

When I try the above, <br/>s can literally be seen being typed on the page and then once the typing finishes, they go away.

Is it possible to prevent all instances of <br/> from being typed, yet parsed in the HTML?

i.e., simulate the following sequence: animate the typing of a sentence, hit return, another sentence, hit return etc.

@srikat
Copy link
Author

srikat commented Apr 9, 2017

Almost managed with

<h1><span id="ityped1"></span><br/><span id="ityped2"></span><br/><span id="ityped3"></span></h1>

and

<script>
	ityped.init('#ityped1', {
		strings:["I don't want just words."],
		typeSpeed: 110, // 55 is the default
		onFinished: function(){
			document.querySelector('.ityped-cursor').style.visibility = 'hidden';

			ityped.init('#ityped2', {
			strings:["If that's all you have for me, you'd better go."],
			typeSpeed: 110, // 55 is the default
			onFinished: function(){
				document.querySelector('.ityped-cursor').style.visibility = 'hidden';

				ityped.init('#ityped3', {
				strings:["F. SCOTT FITZGERALD"],
				typeSpeed: 110, // 55 is the default
				onFinished: function(){
					document.querySelector('.ityped-cursor').style.visibility = 'hidden'
				}
			});
			}
		});
		}
	});
</script>

The problem is that blinking cursor does not go away for 2nd and 3rd lines after the text has been typed.

@luisvinicius167
Copy link
Owner

Hi, sorry for long response! I will try implement this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants