This is a discussion on "How to make a div become visible on clicking a link?" within the Web Page Design section. This forum, and the thread "How to make a div become visible on clicking a link? are both part of the Design Your Website category.
|
|
|
|
|
![]() |
||
How to make a div become visible on clicking a link?
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
How to make a div become visible on clicking a link?
My client wants the user to be able to click on a word or picture and then relevant text to appear beneath which then changes when they click on a different word or picture
I'm guessing its some kind of visible / invisible div but not quite sure how to go about implementing this. Can anyone point me in the right direction or let me know of any issues with doing this? Thanks Last edited by snappy; Mar 28th, 2008 at 13:30. Reason: removed the word 'hotspot' as could be confusing as its not an image map |
|
|
|
#2
|
||||
|
||||
|
Re: How to make a div become visible on clicking a link?
You'll need a touch of Javascript.
This tutorial on hiding and revealing content should help you out
Last Blog Entry: The Google Misconception (Feb 3rd, 2008)
|
|
#3
|
|||
|
|||
|
Re: How to make a div become visible on clicking a link?
Cheers, I had a quick look and looks like it may be helpful.
Will let you know how I get on. Thanks |
|
#4
|
|||
|
|||
|
Re: How to make a div become visible on clicking a link?
Take a look at stu nicholls site CSSPLAY for a purely css version.
Everything on that site is css, if it involves javascript he puts it on another site he created. But just read the source code, looks fairly straightforward. You'd have to way up compatibilty though as that only works on IE6, IE7, Firefox, Netscape, Mozilla and Safari, anyone prior to IE6 it won't work, however that's very few people (and would the javascript even work prior to IE6?) Also some people (again very few) browse with javascript off, or javascript doesn't work through some web proxy's. Just something to look at. -Jake |
|
#5
|
||||
|
||||
|
Re: How to make a div become visible on clicking a link?
So long as the javascript degrades gracefully, then there's no issue in using it.
I agree Bocaj, IE < 6 users are extremely low. I think it's unrealistic for any developer to compensate for these browsers (and their bugs) any more.
Last Blog Entry: The Google Misconception (Feb 3rd, 2008)
|
|
#6
|
||||
|
||||
|
Re: How to make a div become visible on clicking a link?
here are 2 that are pure css could be hacked to work how you want them, no need for javascript
http://www.cssplay.co.uk/menus/page_menu2.html http://www.cssplay.co.uk/menus/drop_lists.html
Last Blog Entry: Strict and Transitional Doctype's (Sep 12th, 2008)
|
|
#7
|
|||
|
|||
|
Re: How to make a div become visible on clicking a link?
I completely misread that before, wow sorry.
i've been working with the mootools framework lately, and it has a feature like this with a smooth transitional effect (for the perfectionist). check it out Fx.Slide I have seen easier (not so visually appealing) versions this before, which if there's content below rather than sliding it down as the div is revealed, is a more jumpy un animated effect. There are other frameworks available to work from, and most people would advise working from a framework is not ideal, but certainly practical. The effects are nice, but not worth the hassle if your knowlege isn't so great on javascript, the mootools forum i found to be a horrible experience with arrogant, unhelpful users. So don't even try it... Just offering another alternative to look at |
|
#8
|
|||
|
|||
|
Re: How to make a div become visible on clicking a link?
Thanks guys!
Quote:
I want the user to click on a link and new content appear below (content further down to move down to make space). Can anyone explain to me how I make an alternative for those w/o JS enabled? Cheers! Snappy |
|
#9
|
||||
|
||||
|
Re: How to make a div become visible on clicking a link?
The alternative should be that everything is just there.
So whilst user may not have the same experience as those with Javascript enabled, the content will still be accessible. This is the key principle behind graceful degradation. I should've checked out the link in more detail beforehand. The developer had not considered the issue. Try tabber instead
Last Blog Entry: The Google Misconception (Feb 3rd, 2008)
|
|
#10
|
|||
|
|||
|
Re: How to make a div become visible on clicking a link?
Thanks aso186 and sorry for delay in replying.
I tried out tabber and its cool but do you think its possible to modify so that the tabs are listed vertically and space below expands to show further info on click? I guess not, so am still looking for a method to click a link and make hidden content below become visible. Plus it needs to degrade gracefully when javascript not enabled. Any ideas?? cheers snappy |
|
#11
|
||||
|
||||
|
Re: How to make a div become visible on clicking a link?
Hello again!
Rather than repeat myself, I wrote a post a while back about an expanding unordered list - download the expanding-menu.zip and check it out! IMO it's pretty flexible, but if you try it out and think it could work but need some tips, just let me know!
Last Blog Entry: The Google Misconception (Feb 3rd, 2008)
|
|
#12
|
|||
|
|||
|
Re: How to make a div become visible on clicking a link?
That looks like it should do the job, thanks!! Will let you know how I get on.... cheers indeed, snappy
|
|
#13
|
|||
|
|||
|
Re: How to make a div become visible on clicking a link?
Have had a quick look and there is just one thing that I hope you can help me with..
is it relatively simple for the previously expanded area to close as you click the next link i.e. so that there is only one expanded area open at a time? sorry, i'm not too hot on javascript! thanks again |
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Changing a session variable when clicking a link? | Crow555 | Classic ASP | 0 | May 15th, 2008 12:22 |
| [SOLVED] How to make a div a link | R8515198 | Web Page Design | 4 | Nov 30th, 2007 08:25 |
| leave link underlined after clicking | monfu | Web Page Design | 9 | May 29th, 2006 17:47 |
| HELP, ASAP- Lag time when clicking on link... how can I fix?? | Snapa02 | Web Page Design | 6 | Apr 26th, 2006 00:18 |
| Insert to db when clicking a link. | Tralesh | Classic ASP | 4 | Jun 8th, 2004 14:58 |