...

View Full Version : How function operate



Graeme Hackston
07-29-2002, 11:23 PM
Do browsers read an entire function before taking actions the function describes? Specifically, will a function written like the example below show all of the divisions prior to hiding some of them if variables are true? If so, would this be noticeable on a slow connection?

function SomeName () {
show('div1','div2','div3','div4');
var a = AVariable
var b = BVariable
if (a) {
hide('div2');
}
if(b) {
hide('div4');
}
}

<edit>the reason I'm trying to write it like this is because it's an onload function and the variables are positons and heights etc. of the divisions</edit>

glenngv
07-30-2002, 02:52 AM
it's not dependent on the internet connection since it's running on the client side, so it depends on the user's machine's resources. But in your code, the divs showing/hiding transition will not be noticeable. Have you tried to run it?

Graeme Hackston
07-30-2002, 03:11 AM
Thanks glenngv

Yes it seems to run fine offline. So, as I understand it, the script is first downloaded then ran meaning the user's resources would have to be quite low for it to be noticable. I'm worrying for not.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum