The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> 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
Darin McGrew
post May 29 2017, 12:49 AM
Post #2


WDG Member
********

Group: Root Admin
Posts: 8,251
Joined: 4-August 06
From: Mountain View, CA
Member No.: 3



It works fine for me when I paste the markup you provided into an HTML file.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
moe46
post May 29 2017, 07:25 AM
Post #3





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



QUOTE(Darin McGrew @ May 29 2017, 12:49 AM) *

It works fine for me when I paste the markup you provided into an HTML file.



Thank you Mr. McGrew. Would you happen to have an idea on why it does not work properly on a WiX platform then?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post May 29 2017, 11:07 AM
Post #4


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 17,624
Joined: 9-August 06
Member No.: 6



I fear no one here has experience with Wix.

I looked at their support pages and got the impression they offer ready made pages and that you can edit a little, but what you posted above is a complete HTML page. So, I'm a little confused.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
moe46
post May 29 2017, 06:58 PM
Post #5





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



QUOTE(pandy @ May 29 2017, 11:07 AM) *

I fear no one here has experience with Wix.

I looked at their support pages and got the impression they offer ready made pages and that you can edit a little, but what you posted above is a complete HTML page. So, I'm a little confused.



See, I'm a big time new comer to HTML and web pages. They have, I guess you can call it a plug-in, where you can paste HTML code into a page and then it shows. When I use the above code it does the typewriter effect. However it runs the sentences together and not on separate lines.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
moe46
post May 29 2017, 08:03 PM
Post #6





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



QUOTE(moe46 @ May 29 2017, 06:58 PM) *

QUOTE(pandy @ May 29 2017, 11:07 AM) *

I fear no one here has experience with Wix.

I looked at their support pages and got the impression they offer ready made pages and that you can edit a little, but what you posted above is a complete HTML page. So, I'm a little confused.



See, I'm a big time new comer to HTML and web pages. They have, I guess you can call it a plug-in, where you can paste HTML code into a page and then it shows. When I use the above code it does the typewriter effect. However it runs the sentences together and not on separate lines.



If it helps I took a video of what happens when I run a test of the HTML on a site I found. So far it works for you, which is confusing because it didn't for me. I am not able to upload the video here I can send it someone if they want to see.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post May 30 2017, 01:16 AM
Post #7


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 17,624
Joined: 9-August 06
Member No.: 6



QUOTE(moe46 @ May 30 2017, 01:58 AM) *

QUOTE(pandy @ May 29 2017, 11:07 AM) *

I fear no one here has experience with Wix.

I looked at their support pages and got the impression they offer ready made pages and that you can edit a little, but what you posted above is a complete HTML page. So, I'm a little confused.



See, I'm a big time new comer to HTML and web pages. They have, I guess you can call it a plug-in, where you can paste HTML code into a page and then it shows. When I use the above code it does the typewriter effect. However it runs the sentences together and not on separate lines.



In that case you shouldn't paste a complete page in with doctype, HTML and BODY tags. Because those are already there. You should just post the snip you want to show, like for instance the below.

CODE
<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>


I don't see how that could be the reason the BR tags went away though. unsure.gif

No, a video wouldn't help. But could you post the URL to your page with your paragraph in it? Then we would have a chance to see what has happened anyway.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

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

 



- Lo-Fi Version Time is now: 25th July 2017 - 01:56 PM