[thelist] [DIVs] can one use a master div to show/hide other divs in sequence?

Jeremy Keith jeremy at adactio.com
Tue Jan 16 22:29:34 CST 2001


Hi Jason,

> Basically I have created a GREAT site (in DHTML of course) which employs a
> very large amount of DIVs... please feel free to perouse the site to be
> farmiliar with my problem... in a sec...
> 
> <http://www.basho.com/> <-- launch the site... its the orange/gray arrows in
> the bottom frame... see what I mean?

You're right. Putting the arrows into their own "master" div would save a
lot of code.

What I would do is define a javascript variable to "remember" which page is
currently showing. e.g. var activePage=1;

Then when someone clicks on a link to go forward or backwards in the pages
(through either the links on the side or the arrows), not only do hide the
current page and show the new one, but also adjust the activePage variable
accordingly. Then immediately check this value to see if it equals the value
of the first or last page, and hide the relevant arrow accordingly.

I've done something similar-ish on my site, http://adactio.com where I
measure the height of the currently active layer to figure out if I should
show or hide arrows for scrolling. Take a peek at the source code and if you
have any questions, fire away.

Lovely site, by the way.

Jeremy Keith

a d @ c t i o   http://adactio.com/








More information about the thelist mailing list