[Javascript] Using same script for a second purpose

Richard nomorebull at charter.net
Mon Feb 28 20:57:06 CST 2005


Dash.

Thanks for the reply.
I found a similar script that does the same thing.
Basically what it does is switches "display" from "none" to "block".
If it is in "block" to begin with, it is switched to "none".


www.somestuff.batcave.net



> Hi Richard,
>
> I've just joined this list, and was looking through it when i came over
> your email. have you sorted it out yet?
>
> this might help, if you haven't. I like to use it for mouseover effects:
>
> function showLayer(layerID){
>  document.getElementById(layerID).style.visibility="visible";
> }
>
> function hideLayer(layerID){
>  document.getElementById(layerID).style.visibility="hidden";
> }
>
> (layerID is the div's id) initially set the div with
> style="...;visibility:hidden;", it works fine on my ie6 and ns7
>
> Dash
>
>
>
>
> The short script is shown below.
> I have a basic layout of 2 columns.
> Column 1 on the left for the main menu.
> Column 2 is split in two parts.
>
> When an item is clicked on in column 1, column 2a shows the thumbnails.
> Consider this a form of image swapping but for text.
> What I would like to do now is, to incorporate a means when a thumbnail is
> clicked on, a large image is shown below that along with a description.
> So far, using the bare bones image swapping works fine, but no
> descriptions. Not to mention being cumbersome and adding a lot of useless
> duplicated script.
>
> I have tried simply renaming the vairables, in a second script, which
> almost works.
> But all that does is, replace the "FirstOn" item which destroys the
> thumbnails.
> I need to maintain the thumbnails in place.
> For a working demo of my inquiry see www.somestuff.batcave.net/menu1.html
>
>
> var kid = "FirstOn"
> function ShowInfo(DivId)
>   {
>   document.getElementById(kid).style.display = 'none';
>   document.getElementById(DivId).style.display = 'block';
>   kid = DivId;
>   }




More information about the Javascript mailing list