SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Threaded View

  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2001
    Ann Arbor, MI
    0 Post(s)
    0 Thread(s)

    Help with hiding/showing DIVs

    OK, a bit of a problem:

    I have a dynamically generated page that has a rollover div that needs to be displayed for each of a number of links.

    Now, this is easy enough to do on a small scale: as part of the loop that dynamically generates the page, I have a separate hidedivlinkID() and showdivlinkID() function, and it works really well except in NS4.x, which I'm not supporting.

    However, once the list of links grows to a certain size--and in this case the list has grown to about 150--the page takes on a rather large size. At this point, it's around 250K.

    What I'd like to do is have a single pair of functions in the header script:

    function showdiv(linkID) { }
    function hidediv(linkID) { }

    Such that I can call them easily. The problem comes in at the point where I try to pass the linkID out of the function, into the style-changing parts of the function. To wit:

    PHP Code:
        function showdiv(linkID) {
    document.getElementById("legend").style.visibility "hidden"
    // End showdiv 
    doesn't work. (The "legend" div is separate and unique; it's not overduplicated). Similarly,

    PHP Code:
        function showdiv(linkID) {
    document.getElementById(linkID).style.visibility "visible"
    document.getElementById("legend").style.visibility "hidden"
    // End showdiv 
    doesn't work.

    Is there any way to make this work... or am I stuck with a bunch of extra functions on my page?

    Eric Snyder II

    (Edit: Closed tag. --ES2)
    Last edited by LazarusLong42; Sep 29, 2001 at 21:21.
    inVirtuo Design. Now open for business.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts