Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,471
There are 1362 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     Programming     Javascript :

Javascript question

Thread title: Javascript question
Closed Thread    
    Thread tools Search this thread Display Modes  
01-15-2007, 07:13 PM
#1
Xi0s is offline Xi0s
Status: Sin Binner
Join date: Dec 2006
Location: Huddersfield, UK
Expertise:
Software:
 
Posts: 384
iTrader: 3 / 83%
 

Xi0s is on a distinguished road

Send a message via MSN to Xi0s

  Old  Javascript question

Hey,

Im trying to write a function that will show divs when a button has been pressed, for example when u press button once, it will show the div q2, then when u press button again it shows div q3, and so on. Thanks in advance

Xi0s

01-16-2007, 01:24 PM
#2
Jeff Andersen is offline Jeff Andersen
Status: Superstar
Join date: Apr 2005
Location:
Expertise:
Software:
 
Posts: 4,449
iTrader: 10 / 100%
 

Jeff Andersen is on a distinguished road

  Old

So each time you click it shows the next div down?

01-16-2007, 01:26 PM
#3
Salathe is offline Salathe
Salathe's Avatar
Status: Community Archaeologist
Join date: Jul 2004
Location: Scotland
Expertise: Software Development
Software: vim, PHP
 
Posts: 3,820
iTrader: 25 / 100%
 

Salathe will become famous soon enough

Send a message via MSN to Salathe

  Old

From a usability standpoint I don't think you want to be doing this. Providing a button which responds with different actions each time it is clicked is a sure fire way to confuse your visitors.

What happens to q2 when the button is pressed to reveal q3?

01-17-2007, 02:27 AM
#4
Wildhoney is offline Wildhoney
Wildhoney's Avatar
Status: Request a custom title
Join date: Feb 2006
Location: Nottingham
Expertise:
Software:
 
Posts: 1,648
iTrader: 18 / 95%
 

Wildhoney is on a distinguished road

Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney

  Old

It does seem somewhat mystifying to me, too. I concur with Salathe, you want to be careful not to confuse your users with this. Nevertheless, I have coded you 2 examples in the following document:

Link: http://www.adam.tiaghosting.com/Xi0s/

I believe the latter of the examples is the 1 you were after. It only occurred to me half way through the former so I continued with it anyway.

Please note that I am using the Prototype framework and so you'll require that file, as well. As Javascript is viewable through source, I leave it entirely up to you to snaffle it.

Incidentally, the reasons I utilised the Prototype framework, apart from gaining access to getElementsByClassName, albeit there are workarounds for this, is because:

a) Compatibility;
b) Prototype is a powerful framework (And I would advocate its use);

At current, I'm merely changing the background colour to show how it works. This would be simple to edit however you desire.

I hope this helps, sir.

01-22-2007, 11:01 PM
#5
Xi0s is offline Xi0s
Status: Sin Binner
Join date: Dec 2006
Location: Huddersfield, UK
Expertise:
Software:
 
Posts: 384
iTrader: 3 / 83%
 

Xi0s is on a distinguished road

Send a message via MSN to Xi0s

  Old

Wildhoney, you are pefect with that spawn new div script sorry it took so long to respond, im no longer doing the job, but that was right up the street . Now im working with a new js script that uses custom image based scrollbars and ajax page management, excellent script and cheap . www.dyn-web.com

Closed Thread    


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed