Help - Search - Members - Calendar
Full Version: WiX HTML and typewriter effect
HTMLHelp Forums > Web Authoring > Cascading Style Sheets
moe46
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>
Darin McGrew
It works fine for me when I paste the markup you provided into an HTML file.
moe46
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?
pandy
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.
moe46
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.
moe46
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.
pandy
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.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2019 Invision Power Services, Inc.