function hideAll() {
var i=0;
for (i=0;i<=2;i++)
{
HideContent('layer') + i;
}}
Wouldn't this execute these statements:
HideContent('layer') + 0;
HideContent('layer') + 1;
HideContent('layer') + 2;
?
Not having seen HideContent, I would have thought that you would want:
HideContent('layer' + 1);
HideContent('layer' + 2);
HideContent('layer' + 3);
If so, I think that the code should read:
function hideAll() {
for (var i=1;i<=3;i++)
{ HideContent('layer' + i); }
}
--
Trevor Lawrence
Canberra
Web Site http://trevorl.mvps.org
<Trevor L.@Canberra> wrote in message
news:uIpe29N...@TK2MSFTNGP02.phx.gbl...
function hideAll() {
for (var i=1;i<=3;i++)
{
HideContent('layer' + i);
}
}
"wildred" <s...@fg.org> сообщил/сообщила в новостях следующее:
news:412CB9D6-2E02-4467...@microsoft.com...
> I think, you call HideContent function in wrong way. :)
> Try this code.
> So, hideAll calls HideContent 3 times and pass 3 params in such order:
> 'layer1', 'layer2' and 'layer3'.
>
> function hideAll() {
> for (var i=1;i<=3;i++)
> {
> HideContent('layer' + i);
> }
>}
For small numbers you might [in this NG] be forgiven for not doing a loop:
function hideAll() {
HideContent('layer1');
HideContent('layer2');
HideContent('layer3');
};
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)