Hello!
I have a problem with Javascript.
I have an element that has to do some things onClick. I was googling how to put few functions into one function and then call main function, like this:
[CODE]
function example()
{
function_one();
function_two();
function_three();
}
This doesn’t work. Only first function does work on click … other don’t. Then I tried even this:
[CODE]
<img src=”…” onClick=”function_one(); function_two(); function_three();”>
And again it doesn’t work.
Here is what one function has to do on click:
[CODE]
show(‘layer1’);
show(‘layer2’);
Spry.Effect.Blind(‘cmenu’, {duration: 1000, from: ‘0%’, to: ‘100%’, toggle: true});
body.id=’body2′;
… where function ‘show’ is:
[CODE]
function show(id)
{
el = document.getElementById(id);
if (el.style.display == ‘none’)
{
el.style.display = ”;
el = document.getElementById(‘more’ + id);
el.innerHTML = ‘less…’;
} else {
el.style.display = ‘none’;
el = document.getElementById(‘more’ + id);
el.innerHTML = ‘more…’;
}
}
… and Spry.Effect.Blind is from Spry framework:
[url]http://labs.adobe.com/technologies/spry/
Thank you!