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

Post by paulfeakins » Tue Jun 19, 2018 6:10 pm


For quick, professional OpenCart support please email info@antropy.co.uk


User avatar
Active Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - Reigate, Surrey, 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?

For quick, professional OpenCart support please email info@antropy.co.uk


User avatar
Active Member

Posts

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

Users browsing this forum: jillc and 36 guests