This is a discussion on "Show and hide content using CSS" within the Web Page Design section. This forum, and the thread "Show and hide content using CSS are both part of the Design Your Website category.
|
|
|
|
|
![]() |
||
Show and hide content using CSS
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
Show and hide content using CSS
Hi,
I want to swop some content in a page out without the page re-loading, basically I have 3 'tabs' each with a little text content associated with them, I would like to show tab 1's content and when clicked for it to be replaced with tab 2 or 3's content. I would imagine it's possible using show/hide with javascript and css. I have found some simlar things around but none that 'replace' the entire content area. Thanks, |
|
#2
|
|||
|
|||
|
Re: Show and hide content using CSS
It can be done with CSS alone, however if you want it to be "Sticky" you would need js to accomplish this. The nice thing is when its done with CSS and you append js to it it will function with or without javascript enabled.
I have a menu example here I built which uses just css and you can also use something like jQuery to very easily add the js functionality. Hope this helps.
Last Blog Entry: Apps every Mac based web dev should consider (Jul 10th, 2008)
|
|
#3
|
|||
|
|||
|
Re: Show and hide content using CSS
you could use the
|
|
#4
|
|||
|
|||
|
Re: Show and hide content using CSS
Its a lot more effective if it is done using unordered lists and nested unordered lists for the show/hide as you need to have an item that can easily and direcetly activate display/hide of the required elements. th eonly reason I recommened jQuery is that with it he can add animation effects and easily handle the show/hide and make it sticky. CSS while it is possible the :active psuedo class only gets you so far and it is a tad more complex of an implementation.
The example i provided shows this and can be easily dissected and used for a base. Salbert if you need any other help just let us know. Simplest example would be:
Last Blog Entry: Apps every Mac based web dev should consider (Jul 10th, 2008)
Last edited by moojoo; Jul 21st, 2008 at 17:50. |
|
#5
|
|||
|
|||
|
Re: Show and hide content using CSS
sorry, I was writing mine out while you posted your first reply moojoo, didn't see it till after I'd posted! yours is the better option!
|
|
#6
|
|||
|
|||
|
Re: Show and hide content using CSS
Quote:
Last Blog Entry: Apps every Mac based web dev should consider (Jul 10th, 2008)
|
|
#7
|
||||
|
||||
|
Re: Show and hide content using CSS
Just another solution - if you want something out-of-the-box and degrades nicely, I've used 'Tabber' in the past which is dead easy to use
Last Blog Entry: The Google Misconception (Feb 3rd, 2008)
|
![]() |
| Tags |
| css, hide, show |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Flash content resets, when javascript hide / show is used (prob in firefox, IE fine) | call14 | Flash & Multimedia Forum | 0 | Feb 4th, 2008 17:12 |
| CSS Show Hide with JS | abis123 | JavaScript Forum | 4 | Dec 13th, 2007 06:39 |
| [SOLVED] Show&Hide Div Box | Maska | JavaScript Forum | 6 | Oct 1st, 2007 12:04 |
| Show/Hide JS | pa007 | JavaScript Forum | 0 | Apr 6th, 2007 20:18 |
| Show/Hide Div Help | Trebz | JavaScript Forum | 2 | Feb 21st, 2006 23:37 |