aprestong
12-04-2006, 05:17 PM
Hi everyone -
I have a quick syntax question - I was hoping someone could help me out.
I set the variable "currentSide" on each onClick:
<a href="#" onClick="Effect.BlindUp('help');Effect.BlindDown('discussionread', {delay: .5});currentSide='discussionread'; return false;">Discussion Board</a>
<a href="#" onClick="Effect.BlindUp('discussionread',{duration:1});Effect.BlindDown('help', {delay: 1});currentSide='help';return false;">Help</a>
I'd like to reference that variable in the beginning as well. I know I need to set a default at the top of the page, but I'm not able to reference that variable in the Effect.BlindUp() portion of the code.
I tried this, but it didn't work.
<a href="#" onClick="Effect.BlindUp('currentSide');Effect.BlindDown('discussionread', {delay: .5});currentSide='discussionread'; return false;">Discussion Board</a>
<a href="#" onClick="Effect.BlindUp('currentSide',{duration:1});Effect.BlindDown('help', {delay: 1});currentSide='help';return false;">Help</a>
I know I'm simply putting it in the spot where scriptaculous is looking for a div name - and you can see that I'm trying to store that div name in the currentSide variable.
In php I'd use 'print $currentSide' - but whats the javascript way to print out that variable so I can use it?
Thanks!
I have a quick syntax question - I was hoping someone could help me out.
I set the variable "currentSide" on each onClick:
<a href="#" onClick="Effect.BlindUp('help');Effect.BlindDown('discussionread', {delay: .5});currentSide='discussionread'; return false;">Discussion Board</a>
<a href="#" onClick="Effect.BlindUp('discussionread',{duration:1});Effect.BlindDown('help', {delay: 1});currentSide='help';return false;">Help</a>
I'd like to reference that variable in the beginning as well. I know I need to set a default at the top of the page, but I'm not able to reference that variable in the Effect.BlindUp() portion of the code.
I tried this, but it didn't work.
<a href="#" onClick="Effect.BlindUp('currentSide');Effect.BlindDown('discussionread', {delay: .5});currentSide='discussionread'; return false;">Discussion Board</a>
<a href="#" onClick="Effect.BlindUp('currentSide',{duration:1});Effect.BlindDown('help', {delay: 1});currentSide='help';return false;">Help</a>
I know I'm simply putting it in the spot where scriptaculous is looking for a div name - and you can see that I'm trying to store that div name in the currentSide variable.
In php I'd use 'print $currentSide' - but whats the javascript way to print out that variable so I can use it?
Thanks!