Technical Discussion
  >> Web Design / HTML / Web hosting Forum


Register (or login) on our website and you will not see this ad.


These posts have been archived and can no longer be replied to or modified.
  Print Thread
Standard User deleted
(deleted) Wed 14-Jul-10 07:18:33
Print Post

Titles, Script and Text - Help Please


[link to this post]
 
Hi, I have a question and maybe someone can help.

I'm putting a new page on my site. I've seen on a few sites that have like a few titles (or headers) in the main body of text. The page only has titles. When you click on one of the titles, the headers underneath move down and the text pertaining to the header appears in a box underneath the title. Similarly, when you click on another title, the previous text vanishes and the new text appears under the header.

Am I making sense, if not I'll try find one of the sites showing this.

What I'm wondering is if there is free text/script downloadable that allows this as I really like it.

Thanks for any help
Standard User deleted
(deleted) Wed 14-Jul-10 08:21:57
Print Post

Re: Titles, Script and Text - Help Please


[re: deleted] [link to this post]
 
I believe it is usually achieved using javascript that alters the CSS display attribute of the container the text in question is in.

Here's an example tutorial with all the code you should need to get started in the right direction:
http://www.cssnewbie.com/showhide-content-css-javasc...


Always make sure to check how the page functions without javascript enabled as some people disable it and you can potentially make the content of your page effectively inaccessible to them.
Standard User deleted
(deleted) Wed 14-Jul-10 08:49:57
Print Post

Re: Titles, Script and Text - Help Please


[re: deleted] [link to this post]
 
i think what you're after is an accordion

easiest way to do it is to get yourself a copy of jquery and bind a function on the header to hide/show the container underneath, or yuo could go the whole hog and use the full monty accordion object in the jquery ui library

i know some people think using a javascript framework is a little heavy-handed but personally, I think it's great - saves a lot of time and typically works in all browsers


Register (or login) on our website and you will not see this ad.

Standard User Taras
(eat-sleep-adslguide) Wed 14-Jul-10 09:19:02
Print Post

Re: Titles, Script and Text - Help Please


[re: deleted] [link to this post]
 
In reply to a post by smiffy12:
Hi, I have a question and maybe someone can help.

I'm putting a new page on my site. I've seen on a few sites that have like a few titles (or headers) in the main body of text. The page only has titles. When you click on one of the titles, the headers underneath move down and the text pertaining to the header appears in a box underneath the title. Similarly, when you click on another title, the previous text vanishes and the new text appears under the header.

Am I making sense, if not I'll try find one of the sites showing this.

What I'm wondering is if there is free text/script downloadable that allows this as I really like it.

Thanks for any help


http://www.downloadjavascripts.com/Vertical_Accordio...

giant list of accordions ..

Minor note be careful not to mix javascript frame works smile (of course i have totally ignored that and used spry, mootools and jquery on one site - opps grin)

_____________________________________________
<randomness>
streaming music - your music - spotify
Everything websites.... soon
My Blog .......... here (still in dev mode)
Me twittering go add
Standard User ukwiz
(fountain of knowledge) Thu 15-Jul-10 14:26:53
Print Post

Re: Titles, Script and Text - Help Please


[re: deleted] [link to this post]
 
In reply to a post by jonathanHodd:
i know some people think using a javascript framework is a little heavy-handed but personally, I think it's great - saves a lot of time and typically works in all browsers
It only works in all browser when javascript is enabled. Quite a few people disable it for security reasons.

Of course and web programmer worth his salt makes sure that the page degrades gracefully and still provides the necessary content.

David

O2 Pro - Unlimited, cheap, some support
Standard User deleted
(deleted) Fri 16-Jul-10 08:42:09
Print Post

Re: Titles, Script and Text - Help Please


[re: ukwiz] [link to this post]
 
"web programmer worth his salt" is a bit of a sweeping generalisation; if you were to spend time making sure everything always degraded gracefully at our place you wouldn't last long wink
  Print Thread

Jump to