Forum Support

Shape 5
August 01, 2021, 04:41:42 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Shape 5 Forum
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Show/Hide Text in an Article? [Answered ]  (Read 247 times)
orbitcod
Jr. Member
**
Offline Offline

Posts: 15



« on: March 02, 2010, 12:39:57 AM »

Say if I wanted to have an element to Show/Hide text in an Article what would I do and what would I edit?

Quote
   1. <html>
   2. <head>
   3. <title>Untitled</title>
   4. <script language="JavaScript">
   5. function showAndHide(theId) {
   6.   var el = document.getElementById(theId);
   7.     var link = document.getElementById("moreLink");
   8.
   9.   if (el.style.display=="none") {
  10.    el.style.display="block"; //show element
  11.         link.innerHTML = "Hide Links...";
  12.   }
  13.   else {
  14.    el.style.display="none"; //hide element
  15.         link.innerHTML = "More...";
  16.   }
  17.     return false;
  18. }
  19. </script>
  20. </head>
  21. <body>
  22. <div style="padding-top:400px">
  23. 01-Intro

  24. 01-Intro

  25. 01-Intro

  26. </div>
  27. <p><a id="moreLink" href="#" onClick="return showAndHide('Title')">More...[/url]</p>
  28. <div id='Title' style="display:none">
  29. 01-Intro

  30. 01-Intro

  31. 01-Intro

  32. </div>
  33. </body>
  34. </html>

Thanks
« Last Edit: March 02, 2010, 04:08:24 PM by orbitcod » Logged
mikek
Administrator
*****
Offline Offline

Posts: 28743



WWW
« Reply #1 on: March 02, 2010, 09:00:26 AM »

Hello, that would require some custom programing but basically you just want javascript to change the css display call by changing it from display:none on load to display:block when it's clicked.
Logged

Mike Knott
------------
Shape 5 Team

- Need a great host for your website? We highly recommend siteground.com!


- Put your trust in the hands of our extremely qualified staff to get your job done right!


- Firebug is the most powerful web development and debugging tool, and it will save you a lot of time, frustration and forum questions:
Install Firebug
orbitcod
Jr. Member
**
Offline Offline

Posts: 15



« Reply #2 on: March 02, 2010, 10:23:49 AM »

Ok thanks for the reply.
Where would I locate this .css for articles?

That should be easy.
Logged
mikek
Administrator
*****
Offline Offline

Posts: 28743



WWW
« Reply #3 on: March 02, 2010, 02:50:59 PM »

Hello, that's part of the problem, the articles need to have unique id's on them to do that, they don't, they only use the classname .contentpage. So there is nothing to identify a single article.
Logged

Mike Knott
------------
Shape 5 Team

- Need a great host for your website? We highly recommend siteground.com!


- Put your trust in the hands of our extremely qualified staff to get your job done right!


- Firebug is the most powerful web development and debugging tool, and it will save you a lot of time, frustration and forum questions:
Install Firebug
orbitcod
Jr. Member
**
Offline Offline

Posts: 15



« Reply #4 on: March 02, 2010, 04:07:56 PM »

Ahh. Ok thanks.

++ Fast Replies Cheesy
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF | SMF © 2013, Simple Machines
Joomla Bridge by JoomlaHacks.com
Valid XHTML 1.0! Valid CSS!
Looking for the largest variety in template designs? Look no more. Never buy 1 theme again. Signups start at just $89 for access to all of our themes.
Send Us An Email
Please send us your questions and we will email you back as soon as we can. Product support questions should be posted in our support forums under the Help menu. Our staff will assist you from there.