The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

> WiX HTML and typewriter effect, Trying to make each 'sentence' start on a new line
moe46
post May 28 2017, 10:34 PM
Post #1





Group: Members
Posts: 4
Joined: 28-May 17
Member No.: 26,420



I need help. When it comes to being a newbie with HTML you can put me at #1. I have the below code and I am using it in a WiX site with their HTML code feature. It does not matter what I do as far as "br/", "/br", "/ br", and "br /" nothing makes each sentence go to a new line. I also included a screenshot of the result. How do I fix this? Thank you in advance.


<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
</head>
<body>
<span id="holder"></span>
<p class="effect">Good morning!<br/>Today we are going to learn about sounds.<br/>The first sound we will practice is “th”.<br/>Are you ready?</p>
</body>
<script>
(function($)
{
$.fn.writeText = function(content) {
var contentArray = content.split(""),
current = 0,
elem = this;
setInterval(function() {
if(current < contentArray.length) {
elem.text(elem.text() + contentArray[current++]);
}
}, 100);
};

})(jQuery);

$(".effect").each(function(index) {
var text = $( this ).text();
$(this).empty();
$(this).writeText(text);
});
//$("#holder").writeText("This is some text");

</script>
</html>


Attached thumbnail(s)
Attached Image
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 19th April 2024 - 01:15 PM