How do I add a toggle between show hide button to an article?

jackymoore10
83 Posts
jackymoore10 posted this 23 April 2017

How do I add a toggle between show hide button to an article?

This is the article I want to add it to:

http://www.redheadgraphicdesign.co.uk/index.php/services

I am currently running a freelance business called Redhead Graphic and Web Design. Applying my passion, knowledge and expertise in this field gained from 5 years of experience in the industry and educational environments, gives me exhilaration and freedom of expression which flows naturally into amazing creative designs. Read More.

I have tried adding this to the article in the front and back end but had no success.

<!DOCTYPE html>
<html>
<head>

$("button").click(function(){
    $("p").toggle();
});

});

<body>

<p>This is a paragraph.</p>

<button>Toggle between hide() and show()</button>

</body>

I got this little bit of code from w3 schools and it works lovely on their site and does just what I need it to do.

https://www.w3schools.com/jquery/tryit.asp?filename=tryjquery_eff_toggle

Can you help?

My article is not a blog.

Jacky.

How do I add a toggle between show hide button to an article? This is the article I want to add it to: http://www.redheadgraphicdesign.co.uk/index.php/services I am currently running a freelance business called Redhead Graphic and Web Design. Applying my passion, knowledge and expertise in this field gained from 5 years of experience in the industry and educational environments, gives me exhilaration and freedom of expression which flows naturally into amazing creative designs. Read More. I have tried adding this to the article in the front and back end but had no success. &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; $("button").click(function(){ $("p").toggle(); }); }); &lt;body&gt; &lt;p&gt;This is a paragraph.&lt;/p&gt; &lt;button&gt;Toggle between hide() and show()&lt;/button&gt; &lt;/body&gt; I got this little bit of code from w3 schools and it works lovely on their site and does just what I need it to do. https://www.w3schools.com/jquery/tryit.asp?filename=tryjquery_eff_toggle Can you help? My article is not a blog. Jacky.
Vote to pay developers attention to this features or issue.
1 Comments
Order By: Standard | Newest
Support Team
Support Team posted this 25 April 2017

Hello Jacky,
in fact you need to incorporate JS code into Joomla article.
The following article should be helpful
http://joom3.zemplate.com/faq/156-how-to-allow-javascript-in-articles-and-modules
https://www.gavick.com/documentation/joomla/templates/customization/custom-javascript-css-php-code

regards,
Aileen

Hello Jacky, in fact you need to incorporate JS code into Joomla article. The following article should be helpful http://joom3.zemplate.com/faq/156-how-to-allow-javascript-in-articles-and-modules https://www.gavick.com/documentation/joomla/templates/customization/custom-javascript-css-php-code regards, Aileen
You must log in or register to leave comments