Page 1 of 1

Click to reveal more text?

Posted: Tue Jun 19, 2018 3:24 pm
by tbaforum
I'm trying to cut down on the amount of boring text on my homepage for customers to scroll past, but at the same time I want the actual text to be there for the sake of Google. Someone suggested to me that I use Jquery to have a short sentence with a click to read more button which reveals text on the same page that was hidden by default. This would make it easy for the customers to scroll past a couple words but for google to see a full page of text.

But how do I do this? I'm practicing the design on a Information page so I can just copy it across to where it goes after it's designed (I'll use an extension which allows me to place text/source on any page/location) but it's simply not working. I've tried this from a tutorial page:
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/j ... "></script>
<script>
$(document).ready(function(){
$("button").click(function(){
$("p").toggle();
});
});
</script>
</head>
<body>

<button>Toggle between hiding and showing the paragraphs</button>

<p>This is a paragraph with little content.</p>
<p>This is another small paragraph.</p>

</body>
</html>
But when I go out of source view it ignores my attempted positioning and just shows regular text with no button.

So is there some kind of code I can simply enter into the source? Anyone have other suggestions?

Re: Click to reveal more text?

Posted: Tue Jun 19, 2018 6:10 pm
by paulfeakins

Re: Click to reveal more text?

Posted: Wed Jun 20, 2018 3:40 pm
by tbaforum
That's their code I quoted in the original post.

Re: Click to reveal more text?

Posted: Wed Jun 20, 2018 5:38 pm
by paulfeakins
So why doesn't it work? Have you got a link to the page you're trying it on?