need to make a loop for a layer hide/show function.
i have designed a website containing about 150 layers that are 'visible' or 'hidden' by the click of a button.
my problem is...
...that i've designed the entire website...
...and now i realize that the html document is too big...
...and is a bit slow when navigating...
i haven't had much experience when it comes to loops...
...so i've ignored this idea until now...
...and now i'm stuck with the situation of having to add loops to reduce the size of the site...
can anyone tell me what the best way to loop the following function is?
any help would be much appreciated...
if you have 150 elements then you should think about a serverside language...
I don't understand what you wanna do yet. How many buttons will there be, and how many layers become visible/hidden when you click each button?
Its hard to explain what server-side scripting can really do for you.
I try... if you have a lot of data don't put them into a flat file...use a database. Based on different cases you can call the data from the database without switching 150 layers.
not much time for server side database.
i don't really have time at the moment to re-design the infrastucture of the site...
...all i'm trying to do for the time being...
...is reduce the size of the site with loops...
...and i'm just wondering if there is a way of making a loop out of this particular function...
...where i get stuck is...
...i make a while loop...
...using i=1 to start...
...then replace kw[1/2/3] with kw[i]...
...i'm not actually sure how to add the 'i'...
...should i put it in quotes like this: "...kw" +i+ "..."?
...i understand the logic of it at least...
...but i'm not sure what i should do with the (a,b,c) part of the function...
...how would the loop incorporate the 'if(a)' part of the function...
...when 'i++' is used to continue the loop...
...how would the if(a) then turn into 'if(b)'?
i'm not sure how clear i'm being about this...
...but the point is...
...i need to know if there is any way of turning this into a loop...
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)