Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > http://my.yahoo.com/ expandable content areas

http://my.yahoo.com/ expandable content areas
Thread Tools
Mac Elite
Join Date: Oct 2001
Status: Offline
Reply With Quote
Nov 24, 2004, 12:13 PM
 
Is there an easy way for a beginner like me to implement these into a site? I am mainly looking for them to expand when they are clicked on, not editing/removing them. If you know of any tutorials please pass them along.
Cheers.

http://my.yahoo.com/ (you have to have an account to see them expand and collapse when the triangles are clicked)
     
mdc
Addicted to MacNN
Join Date: Feb 2003
Location: NY²
Status: Offline
Reply With Quote
Nov 24, 2004, 01:25 PM
 
i know of a quick and easy way to have collapsable sections on your site. the only thing is that they will be loaded depending on how the .html is configured. so if your code is set to them being hidden they need to be clicked on to show, or clicked on to hide.
i do not know any code that would remember the settings for each user.

paste this code into somewhere between your <head> and </head>

Code:
<script type="text/Javascript"> function togglecomments (postid) { var whichpost = document.getElementById(postid); if (whichpost.className=="commentshown") { whichpost.className="commenthidden"; } else { whichpost.className="commentshown"; } } </script>
paste this code into your .css file (or css section in your <head>)
Code:
.commenthidden {display:none} .commentshown {display:inline}
to use this script you need to do a bit of editing.
any section of text/image/whatever that you want to be collapsable you need to surround with this code:
Code:
<span class="commenthidden" id="ID"> </span>
its class is commenthidden, when the page loads that will be hidden, clicking it will show it. if you want it shown and clicking will hide it then change the class to commentshown

and then the triangle/link that you want to use to collapse/show the text/image/whatever needs to have this code:
Code:
<a href="javascript:togglecomments('ID')">text/link/whatever</a>
     
ThisGuy  (op)
Mac Elite
Join Date: Oct 2001
Status: Offline
Reply With Quote
Nov 26, 2004, 10:29 AM
 
wooo! cheers. sorry it took so long for me to reply, but my wife just had a baby and i've been with them at the hospital. i am going to try applying it to my site and i will let you know how it goes. thanks again.
     
mdc
Addicted to MacNN
Join Date: Feb 2003
Location: NY²
Status: Offline
Reply With Quote
Nov 26, 2004, 11:48 AM
 
congratulations with the baby!

boy or girl? name?
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 09:22 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2