Post by tbaforum » Tue Jun 19, 2018 3:24 pm

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?

Newbie

Posts

Joined
Tue Nov 01, 2016 1:04 pm

User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by tbaforum » Wed Jun 20, 2018 3:40 pm

That's their code I quoted in the original post.

Newbie

Posts

Joined
Tue Nov 01, 2016 1:04 pm

Post by paulfeakins » Wed Jun 20, 2018 5:38 pm

So why doesn't it work? Have you got a link to the page you're trying it on?

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom
Who is online

Users browsing this forum: No registered users and 78 guests